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

Unified Diff: base/memory/ref_counted.h

Issue 10332269: RefCounted types should not have public destructors, base/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 8 years, 6 months 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
« no previous file with comments | « no previous file | base/memory/weak_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted.h
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index 858ed2b196044f71109d668566b48f5f45e8be58..ce0d94a81be1eca6f5181687fa2a395636d60bdf 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -85,8 +85,7 @@ class BASE_EXPORT RefCountedThreadSafeBase {
template <class T>
class RefCounted : public subtle::RefCountedBase {
public:
- RefCounted() { }
- ~RefCounted() { }
+ RefCounted() {}
void AddRef() const {
subtle::RefCountedBase::AddRef();
@@ -98,6 +97,9 @@ class RefCounted : public subtle::RefCountedBase {
}
}
+ protected:
+ ~RefCounted() {}
+
private:
DISALLOW_COPY_AND_ASSIGN(RefCounted<T>);
};
@@ -133,8 +135,7 @@ struct DefaultRefCountedThreadSafeTraits {
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase {
public:
- RefCountedThreadSafe() { }
- ~RefCountedThreadSafe() { }
+ RefCountedThreadSafe() {}
void AddRef() const {
subtle::RefCountedThreadSafeBase::AddRef();
@@ -146,6 +147,9 @@ class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase {
}
}
+ protected:
+ ~RefCountedThreadSafe() {}
+
private:
friend struct DefaultRefCountedThreadSafeTraits<T>;
static void DeleteInternal(const T* x) { delete x; }
« no previous file with comments | « no previous file | base/memory/weak_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698