diff options
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h b/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h index c174145..761a856 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h @@ -29,7 +29,7 @@ namespace WTF { // This base class holds the non-template methods and attributes. // The RefCounted class inherits from it reducing the template bloat // generated by the compiler (technique called template hoisting). -class RefCountedBase : Noncopyable { +class RefCountedBase { public: void ref() { @@ -101,7 +101,7 @@ private: }; -template<class T> class RefCounted : public RefCountedBase { +template<class T> class RefCounted : public RefCountedBase, public Noncopyable { public: void deref() { @@ -115,8 +115,23 @@ protected: } }; +template<class T> class RefCountedCustomAllocated : public RefCountedBase, public NoncopyableCustomAllocated { +public: + void deref() + { + if (derefBase()) + delete static_cast<T*>(this); + } + +protected: + ~RefCountedCustomAllocated() + { + } +}; + } // namespace WTF using WTF::RefCounted; +using WTF::RefCountedCustomAllocated; #endif // RefCounted_h |