diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 00:19:18 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 00:19:18 +0000 |
commit | a571d3d39325f0ae3b2e060f3d274b5903cbafcf (patch) | |
tree | 6adaed8b87c549299fbb679e1bb728de9118269a /base/ref_counted.h | |
parent | 952ec4b4ac9a7a92fd3014f782ce0a0ba0ef7b83 (diff) | |
download | chromium_src-a571d3d39325f0ae3b2e060f3d274b5903cbafcf.zip chromium_src-a571d3d39325f0ae3b2e060f3d274b5903cbafcf.tar.gz chromium_src-a571d3d39325f0ae3b2e060f3d274b5903cbafcf.tar.bz2 |
Const-ify RefCountedThreadSafe::AddRef and Release.
Review URL: http://codereview.chromium.org/3869003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/ref_counted.h')
-rw-r--r-- | base/ref_counted.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/base/ref_counted.h b/base/ref_counted.h index 2cc4029..9c84efa 100644 --- a/base/ref_counted.h +++ b/base/ref_counted.h @@ -106,7 +106,7 @@ template <class T, typename Traits> class RefCountedThreadSafe; // count reaches 0. Overload to delete it on a different thread etc. template<typename T> struct DefaultRefCountedThreadSafeTraits { - static void Destruct(T* x) { + static void Destruct(const T* x) { // Delete through RefCountedThreadSafe to make child classes only need to be // friend with RefCountedThreadSafe instead of this struct, which is an // implementation detail. @@ -133,19 +133,19 @@ class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase { RefCountedThreadSafe() { } ~RefCountedThreadSafe() { } - void AddRef() { + void AddRef() const { subtle::RefCountedThreadSafeBase::AddRef(); } - void Release() { + void Release() const { if (subtle::RefCountedThreadSafeBase::Release()) { - Traits::Destruct(static_cast<T*>(this)); + Traits::Destruct(static_cast<const T*>(this)); } } private: friend struct DefaultRefCountedThreadSafeTraits<T>; - static void DeleteInternal(T* x) { delete x; } + static void DeleteInternal(const T* x) { delete x; } DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe); }; |