diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 21:53:08 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 21:53:08 +0000 |
commit | 877d55dcd3e01d1db858f154a1f369e76b2ebaf2 (patch) | |
tree | ee2364ca767826deed3d541603d6c92ca2f0062e /base/ref_counted_memory.h | |
parent | aaa47ee9d83f773d37aa4fd4a04097425ce62063 (diff) | |
download | chromium_src-877d55dcd3e01d1db858f154a1f369e76b2ebaf2.zip chromium_src-877d55dcd3e01d1db858f154a1f369e76b2ebaf2.tar.gz chromium_src-877d55dcd3e01d1db858f154a1f369e76b2ebaf2.tar.bz2 |
First patch in making destructors of refcounted objects private.
BUG=26749
Review URL: http://codereview.chromium.org/360042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/ref_counted_memory.h')
-rw-r--r-- | base/ref_counted_memory.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/ref_counted_memory.h b/base/ref_counted_memory.h index 30d2917..eae7984 100644 --- a/base/ref_counted_memory.h +++ b/base/ref_counted_memory.h @@ -15,16 +15,19 @@ // A generic interface to memory. This object is reference counted because one // of its two subclasses own the data they carry, and we need to have // heterogeneous containers of these two types of memory. -class RefCountedMemory : public base::RefCountedThreadSafe< RefCountedMemory > { +class RefCountedMemory : public base::RefCountedThreadSafe<RefCountedMemory> { public: - virtual ~RefCountedMemory() {} - // Retrieves a pointer to the beginning of the data we point to. If the data // is empty, this will return NULL. virtual const unsigned char* front() const = 0; // Size of the memory pointed to. virtual size_t size() const = 0; + + protected: + friend class base::RefCountedThreadSafe<RefCountedMemory>; + + virtual ~RefCountedMemory() {} }; // An implementation of RefCountedMemory, where the ref counting does not |