MCPcopy Create free account
hub / github.com/cztomczak/cefpython / BindStateBase

Class BindStateBase

src/include/base/internal/cef_callback_internal.h:59–78  ·  view source on GitHub ↗

At the base level, the only task is to add reference counting data. Don't use RefCountedThreadSafe since it requires the destructor to be a virtual method. Creating a vtable for every BindState template instantiation results in a lot of bloat. Its only task is to call the destructor which can be done with a function pointer.

Source from the content-addressed store, hash-verified

57// of bloat. Its only task is to call the destructor which can be done with a
58// function pointer.
59class BindStateBase {
60 protected:
61 explicit BindStateBase(void (*destructor)(BindStateBase*))
62 : ref_count_(0), destructor_(destructor) {}
63 ~BindStateBase() {}
64
65 private:
66 friend class scoped_refptr<BindStateBase>;
67 friend class CallbackBase;
68
69 void AddRef();
70 void Release();
71
72 AtomicRefCount ref_count_;
73
74 // Pointer to a function that will properly destroy |this|.
75 void (*destructor_)(BindStateBase*);
76
77 DISALLOW_COPY_AND_ASSIGN(BindStateBase);
78};
79
80// Holds the Callback methods that don't require specialization to reduce
81// template bloat.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected