diff options
Diffstat (limited to 'third_party/WebKit/Source/wtf/RefCounted.h')
-rw-r--r-- | third_party/WebKit/Source/wtf/RefCounted.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/third_party/WebKit/Source/wtf/RefCounted.h b/third_party/WebKit/Source/wtf/RefCounted.h index 299fb37..db9d082 100644 --- a/third_party/WebKit/Source/wtf/RefCounted.h +++ b/third_party/WebKit/Source/wtf/RefCounted.h @@ -41,7 +41,7 @@ namespace WTF { // generated by the compiler (technique called template hoisting). class WTF_EXPORT RefCountedBase { public: - void ref() + void ref() const { #if CHECK_REF_COUNTED_LIFECYCLE m_verifier.onRef(m_refCount); @@ -89,7 +89,7 @@ protected: } // Returns whether the pointer should be freed or not. - bool derefBase() + bool derefBase() const { ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun); #if CHECK_REF_COUNTED_LIFECYCLE @@ -122,13 +122,13 @@ private: friend void adopted(RefCountedBase*); #endif - int m_refCount; + mutable int m_refCount; #if ENABLE(SECURITY_ASSERT) - bool m_deletionHasBegun; + mutable bool m_deletionHasBegun; #endif #if CHECK_REF_COUNTED_LIFECYCLE - bool m_adoptionIsRequired; - ThreadRestrictionVerifier m_verifier; + mutable bool m_adoptionIsRequired; + mutable ThreadRestrictionVerifier m_verifier; #endif }; @@ -153,10 +153,10 @@ template<typename T> class RefCounted : public RefCountedBase { USING_FAST_MALLOC(T); public: - void deref() + void deref() const { if (derefBase()) - delete static_cast<T*>(this); + delete static_cast<const T*>(this); } protected: |