| Index: base/lazy_instance.h
|
| diff --git a/base/lazy_instance.h b/base/lazy_instance.h
|
| index 4ed471a09bf925ce0598ec78521bb5e8f3bcfce0..5ddc002ba9a4f5e0f995032a30c29c8180ff8c11 100644
|
| --- a/base/lazy_instance.h
|
| +++ b/base/lazy_instance.h
|
| @@ -73,11 +73,18 @@ struct DefaultLazyInstanceTraits {
|
| }
|
| };
|
|
|
| +// We pull out some of the functionality into non-templated functions, so we
|
| +// can implement the more complicated pieces out of line in the .cc file.
|
| +namespace internal {
|
| +
|
| // Use LazyInstance<T>::Leaky for a less-verbose call-site typedef; e.g.:
|
| // base::LazyInstance<T>::Leaky my_leaky_lazy_instance;
|
| // instead of:
|
| -// base::LazyInstance<T, LeakyLazyInstanceTraits<T> > my_leaky_lazy_instance;
|
| +// base::LazyInstance<T, base::internal::LeakyLazyInstanceTraits<T> >
|
| +// my_leaky_lazy_instance;
|
| // (especially when T is MyLongTypeNameImplClientHolderFactory).
|
| +// Only use this internal::-qualified verbose form to extend this traits class
|
| +// (depending on its implementation details).
|
| template <typename Type>
|
| struct LeakyLazyInstanceTraits {
|
| static const bool kRegisterOnExit = false;
|
| @@ -90,10 +97,6 @@ struct LeakyLazyInstanceTraits {
|
| }
|
| };
|
|
|
| -// We pull out some of the functionality into non-templated functions, so we
|
| -// can implement the more complicated pieces out of line in the .cc file.
|
| -namespace internal {
|
| -
|
| // Our AtomicWord doubles as a spinlock, where a value of
|
| // kBeingCreatedMarker means the spinlock is being held for creation.
|
| static const subtle::AtomicWord kLazyInstanceStateCreating = 1;
|
| @@ -124,7 +127,7 @@ class LazyInstance {
|
|
|
| // Convenience typedef to avoid having to repeat Type for leaky lazy
|
| // instances.
|
| - typedef LazyInstance<Type, LeakyLazyInstanceTraits<Type> > Leaky;
|
| + typedef LazyInstance<Type, internal::LeakyLazyInstanceTraits<Type> > Leaky;
|
|
|
| Type& Get() {
|
| return *Pointer();
|
|
|