Chromium Embedded Framework (CEF)  117.1.0+ga287baf+chromium-117.0.5938.62
CefDeleteOnThread< thread > Struct Template Reference

Use this struct in conjuction with refcounted types to ensure that an object is deleted on the specified thread. More...

#include "include/wrapper/cef_helpers.h"

Static Public Member Functions

template<typename T >
static void Destruct (const T *x)
 

Detailed Description

template<CefThreadId thread>
struct CefDeleteOnThread< thread >

Use this struct in conjuction with refcounted types to ensure that an object is deleted on the specified thread.

For example:

  class Foo : public base::RefCountedThreadSafe<Foo, CefDeleteOnUIThread> {
   public:
    Foo();
    void DoSomething();

   private:
    // Allow deletion via scoped_refptr only.
    friend struct CefDeleteOnThread<TID_UI>;
    friend class base::RefCountedThreadSafe<Foo, CefDeleteOnUIThread>;

    virtual ~Foo() {}
  };

  base::scoped_refptr<Foo> foo = new Foo();
  foo->DoSomething();
  foo = NULL;  /// Deletion of |foo| will occur on the UI thread.

Member Function Documentation

◆ Destruct()

template<CefThreadId thread>
template<typename T >
static void CefDeleteOnThread< thread >::Destruct ( const T *  x)
inlinestatic

The documentation for this struct was generated from the following file: