Chromium Embedded Framework (CEF)  114.2.1+gd70a0a8+chromium-114.0.5735.45
base::RefCountedThreadSafe< T, Traits > Class Template Reference

A thread-safe variant of RefCounted<T> More...

#include "include/base/cef_ref_counted.h"

Inheritance diagram for base::RefCountedThreadSafe< T, Traits >:

Public Member Functions

 RefCountedThreadSafe ()
 
 RefCountedThreadSafe (const RefCountedThreadSafe &)=delete
 
RefCountedThreadSafeoperator= (const RefCountedThreadSafe &)=delete
 
void AddRef () const
 
void Release () const
 

Static Public Attributes

static constexpr cef_subtle::StartRefCountFromZeroTag kRefCountPreference
 

Protected Member Functions

 ~RefCountedThreadSafe ()=default
 

Friends

struct DefaultRefCountedThreadSafeTraits< T >
 

Detailed Description

template<class T, typename Traits = DefaultRefCountedThreadSafeTraits<T>>
class base::RefCountedThreadSafe< T, Traits >

A thread-safe variant of RefCounted<T>

  class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
   ...
  };

If you're using the default trait, then you should add compile time asserts that no one else is deleting your object. i.e.

   private:
    friend class base::RefCountedThreadSafe<MyFoo>;
    ~MyFoo();

We can use REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE() with RefCountedThreadSafe too. See the comment above the RefCounted definition for details.

Constructor & Destructor Documentation

◆ RefCountedThreadSafe() [1/2]

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
base::RefCountedThreadSafe< T, Traits >::RefCountedThreadSafe ( )
inlineexplicit

◆ RefCountedThreadSafe() [2/2]

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
base::RefCountedThreadSafe< T, Traits >::RefCountedThreadSafe ( const RefCountedThreadSafe< T, Traits > &  )
delete

◆ ~RefCountedThreadSafe()

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
base::RefCountedThreadSafe< T, Traits >::~RefCountedThreadSafe ( )
protecteddefault

Member Function Documentation

◆ AddRef()

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
void base::RefCountedThreadSafe< T, Traits >::AddRef ( ) const
inline

◆ operator=()

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
RefCountedThreadSafe& base::RefCountedThreadSafe< T, Traits >::operator= ( const RefCountedThreadSafe< T, Traits > &  )
delete

◆ Release()

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
void base::RefCountedThreadSafe< T, Traits >::Release ( ) const
inline

Friends And Related Function Documentation

◆ DefaultRefCountedThreadSafeTraits< T >

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
friend struct DefaultRefCountedThreadSafeTraits< T >
friend

Member Data Documentation

◆ kRefCountPreference

template<class T , typename Traits = DefaultRefCountedThreadSafeTraits<T>>
constexpr cef_subtle::StartRefCountFromZeroTag base::RefCountedThreadSafe< T, Traits >::kRefCountPreference
staticconstexpr
Initial value:
=
cef_subtle::kStartRefCountFromZeroTag

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