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

Unified Diff: base/lazy_instance.h

Issue 9192024: Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
Index: base/lazy_instance.h
diff --git a/base/lazy_instance.h b/base/lazy_instance.h
index ededc73cbbaeba9d426c85e7d85ef4a9be7b0ed6..1702b41cb27c77dee202a4a9d29bf3b2c40fba0c 100644
--- a/base/lazy_instance.h
+++ b/base/lazy_instance.h
@@ -73,6 +73,7 @@ struct DefaultLazyInstanceTraits {
}
};
+// Use LazyInstance<T>::Leaky for a less-verbose call-site typedef.
wtc 2012/01/21 00:51:01 Nit: would be nice to give an example. Before I s
Ami GONE FROM CHROMIUM 2012/01/21 01:22:30 Done.
template <typename Type>
struct LeakyLazyInstanceTraits {
static const bool kRegisterOnExit = false;
@@ -117,6 +118,10 @@ class LazyInstance {
// the OnExit member function, where needed.
// ~LazyInstance() {}
+ // Convenience typedef to avoid having to repeat Type for leaky lazy
+ // instances.
+ typedef LazyInstance<Type, LeakyLazyInstanceTraits<Type> > Leaky;
+
Type& Get() {
return *Pointer();
}
« no previous file with comments | « base/debug/trace_event.cc ('k') | base/lazy_instance_unittest.cc » ('j') | net/ocsp/nss_ocsp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698