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

Unified Diff: base/singleton.h

Issue 2042003: Switch some Singletons to use LeakySingleton. Base URL: http://src.chromium.org/git/chromium.git
Patch Set: More build fixes. Created 10 years, 7 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 | « base/logging_win.cc ('k') | base/singleton_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/singleton.h
diff --git a/base/singleton.h b/base/singleton.h
index 3272fce471caa43fb45726ca010863e0b2c027d5..fb4d1eb4b9d2754701bd4077f496c24f734cee7e 100644
--- a/base/singleton.h
+++ b/base/singleton.h
@@ -90,7 +90,7 @@ struct LeakySingletonTraits : public DefaultSingletonTraits<Type> {
// FooClass() { ... }
// friend struct DefaultSingletonTraits<FooClass>;
//
-// DISALLOW_EVIL_CONSTRUCTORS(FooClass);
+// DISALLOW_COPY_AND_ASSIGN(FooClass);
// };
//
// Caveats:
@@ -185,6 +185,13 @@ class Singleton {
static base::subtle::AtomicWord instance_;
};
+template <typename Type, typename DifferentiatingType = Type>
+class LeakySingleton
+ : public Singleton<Type,
+ LeakySingletonTraits<Type>,
+ DifferentiatingType> {
+};
+
template <typename Type, typename Traits, typename DifferentiatingType>
base::subtle::AtomicWord Singleton<Type, Traits, DifferentiatingType>::
instance_ = 0;
« no previous file with comments | « base/logging_win.cc ('k') | base/singleton_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698