Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3436)

Unified Diff: base/ref_counted_memory.h

Issue 360042: First patch in making destructors of refcounted objects private. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/ref_counted_memory.h
===================================================================
--- base/ref_counted_memory.h (revision 30973)
+++ base/ref_counted_memory.h (working copy)
@@ -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

Powered by Google App Engine
This is Rietveld 408576698