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

Side by Side Diff: src/base/lazy-instance.h

Issue 1371083003: [presubmit] Enable readability/namespace linter checking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/base/cpu.cc ('k') | src/base/macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The LazyInstance<Type, Traits> class manages a single instance of Type, 5 // The LazyInstance<Type, Traits> class manages a single instance of Type,
6 // which will be lazily created on the first time it's accessed. This class is 6 // which will be lazily created on the first time it's accessed. This class is
7 // useful for places you would normally use a function-level static, but you 7 // useful for places you would normally use a function-level static, but you
8 // need to have guaranteed thread-safety. The Type constructor will only ever 8 // need to have guaranteed thread-safety. The Type constructor will only ever
9 // be called once, even if two threads are racing to create the object. Get() 9 // be called once, even if two threads are racing to create the object. Get()
10 // and Pointer() will always return the same, completely initialized instance. 10 // and Pointer() will always return the same, completely initialized instance.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 template <typename T, 226 template <typename T,
227 typename CreateTrait = DefaultCreateTrait<T>, 227 typename CreateTrait = DefaultCreateTrait<T>,
228 typename InitOnceTrait = ThreadSafeInitOnceTrait, 228 typename InitOnceTrait = ThreadSafeInitOnceTrait,
229 typename DestroyTrait = LeakyInstanceTrait<T> > 229 typename DestroyTrait = LeakyInstanceTrait<T> >
230 struct LazyDynamicInstance { 230 struct LazyDynamicInstance {
231 typedef LazyInstanceImpl<T, DynamicallyAllocatedInstanceTrait<T>, 231 typedef LazyInstanceImpl<T, DynamicallyAllocatedInstanceTrait<T>,
232 CreateTrait, InitOnceTrait, DestroyTrait> type; 232 CreateTrait, InitOnceTrait, DestroyTrait> type;
233 }; 233 };
234 234
235 } } // namespace v8::base 235 } // namespace base
236 } // namespace v8
236 237
237 #endif // V8_BASE_LAZY_INSTANCE_H_ 238 #endif // V8_BASE_LAZY_INSTANCE_H_
OLDNEW
« no previous file with comments | « src/base/cpu.cc ('k') | src/base/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698