diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 13:31:49 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 13:31:49 +0000 |
commit | 6de0fd1d935e8c6c9257f1082dbd227acb1a06b1 (patch) | |
tree | 0ed5bc4ef9c2da0b498c30e562218f4528eaac9e | |
parent | 0f86c358fdb5e47aa9cd4a99b12da5e66507d080 (diff) | |
download | chromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.zip chromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.tar.gz chromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.tar.bz2 |
Allow linker initialization of lazy instance
Using the initializer list construct = {0} allows the object to be linker initialized.
Modify the LazyInstance class design to make it a pod aggregate type that can be linker initialized this way. Also combines the instance and state members, in line with the Singleton<> class design.
Introduces a new LAZY_INSTANCE_INITIALIZER macro specifically for using to init all lazy instances + modify all existing callsites to use it. (Old code would no longer compile)
BUG=94925
TEST=existing tests pass. http://build.chromium.org/f/chromium/perf/linux-release/sizes/report.html?history=150&header=chrome-si&graph=chrome-si&rev=-1 should step downward.
TBR=jam@chromium.org,rvargas@chromium.org,darin@chromium.org,ben@chromium.org,apatrick@chromium.org,akalin@chromium.org
Review URL: http://codereview.chromium.org/8491043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
164 files changed, 386 insertions, 373 deletions
diff --git a/base/debug/trace_event.cc b/base/debug/trace_event.cc index 0550ca3..5d5eebb 100644 --- a/base/debug/trace_event.cc +++ b/base/debug/trace_event.cc @@ -61,7 +61,7 @@ int g_category_index = 3; // skip initial 3 categories // The most-recently captured name of the current thread LazyInstance<ThreadLocalPointer<char>, LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > - g_current_thread_name(LINKER_INITIALIZED); + g_current_thread_name = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc index ab4cd41..6dc4ab9 100644 --- a/base/files/file_path_watcher_linux.cc +++ b/base/files/file_path_watcher_linux.cc @@ -218,8 +218,8 @@ class InotifyReaderTask : public Task { DISALLOW_COPY_AND_ASSIGN(InotifyReaderTask); }; -static base::LazyInstance<InotifyReader> g_inotify_reader( - base::LINKER_INITIALIZED); +static base::LazyInstance<InotifyReader> g_inotify_reader = + LAZY_INSTANCE_INITIALIZER; InotifyReader::InotifyReader() : thread_("inotify_reader"), diff --git a/base/i18n/number_formatting.cc b/base/i18n/number_formatting.cc index b2eeb16..246425e 100644 --- a/base/i18n/number_formatting.cc +++ b/base/i18n/number_formatting.cc @@ -36,8 +36,10 @@ struct NumberFormatWrapper { scoped_ptr<icu::NumberFormat> number_format; }; -LazyInstance<NumberFormatWrapper> g_number_format_int(LINKER_INITIALIZED); -LazyInstance<NumberFormatWrapper> g_number_format_float(LINKER_INITIALIZED); +LazyInstance<NumberFormatWrapper> g_number_format_int = + LAZY_INSTANCE_INITIALIZER; +LazyInstance<NumberFormatWrapper> g_number_format_float = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/lazy_instance.cc b/base/lazy_instance.cc index 1be3488..a81cb8c 100644 --- a/base/lazy_instance.cc +++ b/base/lazy_instance.cc @@ -11,15 +11,18 @@ #include "base/third_party/dynamic_annotations/dynamic_annotations.h" namespace base { - -bool LazyInstanceHelper::NeedsInstance() { - // Try to create the instance, if we're the first, will go from EMPTY - // to CREATING, otherwise we've already been beaten here. - // The memory access has no memory ordering as STATE_EMPTY and STATE_CREATING - // has no associated data (memory barriers are all about ordering - // of memory accesses to *associated* data). - if (base::subtle::NoBarrier_CompareAndSwap( - &state_, STATE_EMPTY, STATE_CREATING) == STATE_EMPTY) +namespace internal { + +// TODO(joth): This function could be shared with Singleton, in place of its +// WaitForInstance() call. +bool NeedsLazyInstance(subtle::AtomicWord* state) { + // Try to create the instance, if we're the first, will go from 0 to + // kLazyInstanceStateCreating, otherwise we've already been beaten here. + // The memory access has no memory ordering as state 0 and + // kLazyInstanceStateCreating have no associated data (memory barriers are + // all about ordering of memory accesses to *associated* data). + if (subtle::NoBarrier_CompareAndSwap(state, 0, + kLazyInstanceStateCreating) == 0) // Caller must create instance return true; @@ -27,29 +30,30 @@ bool LazyInstanceHelper::NeedsInstance() { // The load has acquire memory ordering as a thread which sees // state_ == STATE_CREATED needs to acquire visibility over // the associated data (buf_). Pairing Release_Store is in - // CompleteInstance(). - while (base::subtle::Acquire_Load(&state_) != STATE_CREATED) + // CompleteLazyInstance(). + while (subtle::Acquire_Load(state) == kLazyInstanceStateCreating) { PlatformThread::YieldCurrentThread(); - + } // Someone else created the instance. return false; } -void LazyInstanceHelper::CompleteInstance(void* instance, void (*dtor)(void*)) { +void CompleteLazyInstance(subtle::AtomicWord* state, + subtle::AtomicWord new_instance, + void* lazy_instance, + void (*dtor)(void*)) { // See the comment to the corresponding HAPPENS_AFTER in Pointer(). - ANNOTATE_HAPPENS_BEFORE(&state_); + ANNOTATE_HAPPENS_BEFORE(state); // Instance is created, go from CREATING to CREATED. - // Releases visibility over buf_ to readers. Pairing Acquire_Load's are in - // NeedsInstance() and Pointer(). - base::subtle::Release_Store(&state_, STATE_CREATED); + // Releases visibility over private_buf_ to readers. Pairing Acquire_Load's + // are in NeedsInstance() and Pointer(). + subtle::Release_Store(state, new_instance); // Make sure that the lazily instantiated object will get destroyed at exit. if (dtor) - base::AtExitManager::RegisterCallback(dtor, instance); + AtExitManager::RegisterCallback(dtor, lazy_instance); } +} // namespace internal } // namespace base - - - diff --git a/base/lazy_instance.h b/base/lazy_instance.h index ac94a00..ededc73 100644 --- a/base/lazy_instance.h +++ b/base/lazy_instance.h @@ -14,7 +14,7 @@ // LazyInstance is completely thread safe, assuming that you create it safely. // The class was designed to be POD initialized, so it shouldn't require a // static constructor. It really only makes sense to declare a LazyInstance as -// a global variable using the base::LinkerInitialized constructor. +// a global variable using the LAZY_INSTANCE_INITIALIZER initializer. // // LazyInstance is similar to Singleton, except it does not have the singleton // property. You can have multiple LazyInstance's of the same type, and each @@ -24,7 +24,7 @@ // requires that Type be a complete type so we can determine the size. // // Example usage: -// static LazyInstance<MyClass> my_instance(base::LINKER_INITIALIZED); +// static LazyInstance<MyClass> my_instance = LAZY_INSTANCE_INITIALIZER; // void SomeMethod() { // my_instance.Get().SomeMethod(); // MyClass::SomeMethod() // @@ -45,6 +45,12 @@ #include "base/third_party/dynamic_annotations/dynamic_annotations.h" #include "base/threading/thread_restrictions.h" +// LazyInstance uses its own struct initializer-list style static +// initialization, as base's LINKER_INITIALIZED requires a constructor and on +// some compilers (notably gcc 4.4) this still ends up needing runtime +// initialization. +#define LAZY_INSTANCE_INITIALIZER {0} + namespace base { template <typename Type> @@ -79,53 +85,36 @@ struct LeakyLazyInstanceTraits { } }; -// We pull out some of the functionality into a non-templated base, so that we +// 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. -class BASE_EXPORT LazyInstanceHelper { - protected: - enum { - STATE_EMPTY = 0, - STATE_CREATING = 1, - STATE_CREATED = 2 - }; - - explicit LazyInstanceHelper(LinkerInitialized /*unused*/) {/* state_ is 0 */} - - // Declaring a destructor (even if it's empty) will cause MSVC to register a - // static initializer to register the empty destructor with atexit(). - - // A destructor is intentionally not defined. If we were to say - // ~LazyInstanceHelper() { } - // Even though it's empty, a destructor will still be generated. - // In order for the constructor to be called for static variables, - // it will be registered as a callback at runtime with AtExit(). - // We don't want this, so we don't declare a destructor at all, - // effectively keeping the type POD (at least in terms of - // initialization and destruction). - - // Check if instance needs to be created. If so return true otherwise - // if another thread has beat us, wait for instance to be created and - // return false. - bool NeedsInstance(); - - // After creating an instance, call this to register the dtor to be called - // at program exit and to update the state to STATE_CREATED. - void CompleteInstance(void* instance, void (*dtor)(void*)); - - base::subtle::Atomic32 state_; +namespace internal { - private: - DISALLOW_COPY_AND_ASSIGN(LazyInstanceHelper); -}; +// 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; + +// Check if instance needs to be created. If so return true otherwise +// if another thread has beat us, wait for instance to be created and +// return false. +BASE_EXPORT bool NeedsLazyInstance(subtle::AtomicWord* state); + +// After creating an instance, call this to register the dtor to be called +// at program exit and to update the atomic state to hold the |new_instance| +BASE_EXPORT void CompleteLazyInstance(subtle::AtomicWord* state, + subtle::AtomicWord new_instance, + void* lazy_instance, + void (*dtor)(void*)); + +} // namespace internal template <typename Type, typename Traits = DefaultLazyInstanceTraits<Type> > -class LazyInstance : public LazyInstanceHelper { +class LazyInstance { public: - explicit LazyInstance(LinkerInitialized x) : LazyInstanceHelper(x) { } - - // Declaring a destructor (even if it's empty) will cause MSVC to register a - // static initializer to register the empty destructor with atexit(). - // Refer to the destructor-related comment in LazyInstanceHelper. + // Do not define a destructor, as doing so makes LazyInstance a + // non-POD-struct. We don't want that because then a static initializer will + // be created to register the (empty) destructor with atexit() under MSVC, for + // example. We handle destruction of the contained Type class explicitly via + // the OnExit member function, where needed. // ~LazyInstance() {} Type& Get() { @@ -136,61 +125,72 @@ class LazyInstance : public LazyInstanceHelper { #ifndef NDEBUG // Avoid making TLS lookup on release builds. if (!Traits::kAllowedToAccessOnNonjoinableThread) - base::ThreadRestrictions::AssertSingletonAllowed(); + ThreadRestrictions::AssertSingletonAllowed(); #endif + // If any bit in the created mask is true, the instance has already been + // fully constructed. + static const subtle::AtomicWord kLazyInstanceCreatedMask = + ~internal::kLazyInstanceStateCreating; // We will hopefully have fast access when the instance is already created. - // Since a thread sees state_ != STATE_CREATED at most once, - // the load is taken out of NeedsInstance() as a fast-path. + // Since a thread sees private_instance_ == 0 or kLazyInstanceStateCreating + // at most once, the load is taken out of NeedsInstance() as a fast-path. // The load has acquire memory ordering as a thread which sees - // state_ == STATE_CREATED needs to acquire visibility over - // the associated data (buf_). Pairing Release_Store is in - // CompleteInstance(). - if ((base::subtle::Acquire_Load(&state_) != STATE_CREATED) && - NeedsInstance()) { - // Create the instance in the space provided by |buf_|. - instance_ = Traits::New(buf_); - CompleteInstance(this, Traits::kRegisterOnExit ? OnExit : NULL); + // private_instance_ > creating needs to acquire visibility over + // the associated data (private_buf_). Pairing Release_Store is in + // CompleteLazyInstance(). + subtle::AtomicWord value = subtle::Acquire_Load(&private_instance_); + if (!(value & kLazyInstanceCreatedMask) && + internal::NeedsLazyInstance(&private_instance_)) { + // Create the instance in the space provided by |private_buf_|. + value = reinterpret_cast<subtle::AtomicWord>(Traits::New(private_buf_)); + internal::CompleteLazyInstance(&private_instance_, value, this, + Traits::kRegisterOnExit ? OnExit : NULL); } // This annotation helps race detectors recognize correct lock-less // synchronization between different threads calling Pointer(). // We suggest dynamic race detection tool that "Traits::New" above - // and CompleteInstance(...) happens before "return instance_" below. - // See the corresponding HAPPENS_BEFORE in CompleteInstance(...). - ANNOTATE_HAPPENS_AFTER(&state_); - return instance_; + // and CompleteLazyInstance(...) happens before "return instance()" below. + // See the corresponding HAPPENS_BEFORE in CompleteLazyInstance(...). + ANNOTATE_HAPPENS_AFTER(&private_instance_); + return instance(); } bool operator==(Type* p) { - switch (base::subtle::NoBarrier_Load(&state_)) { - case STATE_EMPTY: + switch (subtle::NoBarrier_Load(&private_instance_)) { + case 0: return p == NULL; - case STATE_CREATING: - return static_cast<int8*>(static_cast<void*>(p)) == buf_; - case STATE_CREATED: - return p == instance_; + case internal::kLazyInstanceStateCreating: + return static_cast<int8*>(static_cast<void*>(p)) == private_buf_; default: - return false; + return p == instance(); } } + // Effectively private: member data is only public to allow the linker to + // statically initialize it. DO NOT USE FROM OUTSIDE THIS CLASS. + + // Note this must use AtomicWord, not Atomic32, to ensure correct alignment + // of |private_buf_| on 64 bit architectures. (This member must be first to + // allow the syntax used in LAZY_INSTANCE_INITIALIZER to work correctly.) + subtle::AtomicWord private_instance_; + int8 private_buf_[sizeof(Type)]; // Preallocated space for the Type instance. + private: + Type* instance() { + return reinterpret_cast<Type*>(subtle::NoBarrier_Load(&private_instance_)); + } + // Adapter function for use with AtExit. This should be called single // threaded, so don't synchronize across threads. // Calling OnExit while the instance is in use by other threads is a mistake. static void OnExit(void* lazy_instance) { LazyInstance<Type, Traits>* me = reinterpret_cast<LazyInstance<Type, Traits>*>(lazy_instance); - Traits::Delete(me->instance_); - me->instance_ = NULL; - base::subtle::Release_Store(&me->state_, STATE_EMPTY); + Traits::Delete(me->instance()); + subtle::Release_Store(&me->private_instance_, 0); } - - Type *instance_; - int8 buf_[sizeof(Type)]; // Preallocate the space for the Type instance. - - DISALLOW_COPY_AND_ASSIGN(LazyInstance); }; } // namespace base diff --git a/base/lazy_instance_unittest.cc b/base/lazy_instance_unittest.cc index 28bf04e..b177745 100644 --- a/base/lazy_instance_unittest.cc +++ b/base/lazy_instance_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -56,8 +56,8 @@ class SlowDelegate : public base::DelegateSimpleThread::Delegate { } // namespace -static base::LazyInstance<ConstructAndDestructLogger> lazy_logger( - base::LINKER_INITIALIZED); +static base::LazyInstance<ConstructAndDestructLogger> lazy_logger = + LAZY_INSTANCE_INITIALIZER; TEST(LazyInstanceTest, Basic) { { @@ -78,7 +78,8 @@ TEST(LazyInstanceTest, Basic) { EXPECT_EQ(4, destructed_seq_.GetNext()); } -static base::LazyInstance<SlowConstructor> lazy_slow(base::LINKER_INITIALIZED); +static base::LazyInstance<SlowConstructor> lazy_slow = + LAZY_INSTANCE_INITIALIZER; TEST(LazyInstanceTest, ConstructorThreadSafety) { { @@ -122,7 +123,7 @@ TEST(LazyInstanceTest, LeakyLazyInstance) { bool deleted1 = false; { base::ShadowingAtExitManager shadow; - static base::LazyInstance<DeleteLogger> test(base::LINKER_INITIALIZED); + static base::LazyInstance<DeleteLogger> test = LAZY_INSTANCE_INITIALIZER; test.Get().SetDeletedPtr(&deleted1); } EXPECT_TRUE(deleted1); @@ -134,7 +135,7 @@ TEST(LazyInstanceTest, LeakyLazyInstance) { base::ShadowingAtExitManager shadow; static base::LazyInstance<DeleteLogger, base::LeakyLazyInstanceTraits<DeleteLogger> > - test(base::LINKER_INITIALIZED); + test = LAZY_INSTANCE_INITIALIZER; test.Get().SetDeletedPtr(&deleted2); } EXPECT_FALSE(deleted2); diff --git a/base/mac/scoped_nsexception_enabler.mm b/base/mac/scoped_nsexception_enabler.mm index 6815de3..f5559f0 100644 --- a/base/mac/scoped_nsexception_enabler.mm +++ b/base/mac/scoped_nsexception_enabler.mm @@ -16,7 +16,7 @@ namespace { // Whether to allow NSExceptions to be raised on the current thread. LazyInstance<ThreadLocalBoolean, LeakyLazyInstanceTraits<ThreadLocalBoolean> > - g_exceptionsAllowed(base::LINKER_INITIALIZED); + g_exceptionsAllowed = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/message_loop.cc b/base/message_loop.cc index c04fa8b..f4db323 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -42,8 +42,8 @@ namespace { // A lazily created thread local storage for quick access to a thread's message // loop, if one exists. This should be safe and free of static constructors. -base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr( - base::LINKER_INITIALIZED); +base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr = + LAZY_INSTANCE_INITIALIZER; // Logical events for Histogram profiling. Run with -message-loop-histogrammer // to get an accounting of messages and actions taken on each thread. diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc index 77e9ae3..fa08bc0 100644 --- a/base/nix/mime_util_xdg.cc +++ b/base/nix/mime_util_xdg.cc @@ -35,7 +35,7 @@ namespace { // this lock. static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_mime_util_xdg_lock(base::LINKER_INITIALIZED); + g_mime_util_xdg_lock = LAZY_INSTANCE_INITIALIZER; class IconTheme; diff --git a/base/path_service.cc b/base/path_service.cc index 21eea9c..256318c 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -134,7 +134,7 @@ struct PathData { } }; -static base::LazyInstance<PathData> g_path_data(base::LINKER_INITIALIZED); +static base::LazyInstance<PathData> g_path_data = LAZY_INSTANCE_INITIALIZER; static PathData* GetPathData() { return g_path_data.Pointer(); diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc index f23330a..6abf5f8 100644 --- a/base/rand_util_posix.cc +++ b/base/rand_util_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -36,7 +36,7 @@ class URandomFd { int fd_; }; -base::LazyInstance<URandomFd> g_urandom_fd(base::LINKER_INITIALIZED); +base::LazyInstance<URandomFd> g_urandom_fd = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc index 1ada002..f1c6664 100644 --- a/base/sys_info_chromeos.cc +++ b/base/sys_info_chromeos.cc @@ -40,7 +40,7 @@ struct ChromeOSVersionNumbers { }; static base::LazyInstance<ChromeOSVersionNumbers> - g_chrome_os_version_numbers(base::LINKER_INITIALIZED); + g_chrome_os_version_numbers = LAZY_INSTANCE_INITIALIZER; // static void SysInfo::OperatingSystemVersionNumbers(int32* major_version, diff --git a/base/third_party/dmg_fp/dtoa_wrapper.cc b/base/third_party/dmg_fp/dtoa_wrapper.cc index ca49607..4599df4 100644 --- a/base/third_party/dmg_fp/dtoa_wrapper.cc +++ b/base/third_party/dmg_fp/dtoa_wrapper.cc @@ -12,10 +12,10 @@ // A single lock would lead to an attempted recursive grab. static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - dtoa_lock_0(base::LINKER_INITIALIZED); + dtoa_lock_0 = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - dtoa_lock_1(base::LINKER_INITIALIZED); + dtoa_lock_1 = LAZY_INSTANCE_INITIALIZER; /* * This define and the code below is to trigger thread-safe behavior diff --git a/base/threading/platform_thread_mac.mm b/base/threading/platform_thread_mac.mm index a530157..59f2621 100644 --- a/base/threading/platform_thread_mac.mm +++ b/base/threading/platform_thread_mac.mm @@ -20,7 +20,7 @@ namespace { LazyInstance<ThreadLocalPointer<char>, LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > - current_thread_name(LINKER_INITIALIZED); + current_thread_name = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc index 772d1f2..872cb56 100644 --- a/base/threading/platform_thread_posix.cc +++ b/base/threading/platform_thread_posix.cc @@ -44,7 +44,7 @@ namespace { // Mac name code is in in platform_thread_mac.mm. LazyInstance<ThreadLocalPointer<char>, LeakyLazyInstanceTraits<ThreadLocalPointer<char> > > - current_thread_name(LINKER_INITIALIZED); + current_thread_name = LAZY_INSTANCE_INITIALIZER; #endif struct ThreadParams { diff --git a/base/threading/thread.cc b/base/threading/thread.cc index 616aac8..076580d 100644 --- a/base/threading/thread.cc +++ b/base/threading/thread.cc @@ -17,8 +17,8 @@ namespace { // because its Stop method was called. This allows us to catch cases where // MessageLoop::Quit() is called directly, which is unexpected when using a // Thread to setup and run a MessageLoop. -base::LazyInstance<base::ThreadLocalBoolean> lazy_tls_bool( - base::LINKER_INITIALIZED); +base::LazyInstance<base::ThreadLocalBoolean> lazy_tls_bool = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/base/threading/thread_restrictions.cc b/base/threading/thread_restrictions.cc index a0c24b0..073349c 100644 --- a/base/threading/thread_restrictions.cc +++ b/base/threading/thread_restrictions.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,10 +16,10 @@ namespace base { namespace { LazyInstance<ThreadLocalBoolean, LeakyLazyInstanceTraits<ThreadLocalBoolean> > - g_io_disallowed(LINKER_INITIALIZED); + g_io_disallowed = LAZY_INSTANCE_INITIALIZER; LazyInstance<ThreadLocalBoolean, LeakyLazyInstanceTraits<ThreadLocalBoolean> > - g_singleton_disallowed(LINKER_INITIALIZED); + g_singleton_disallowed = LAZY_INSTANCE_INITIALIZER; } // anonymous namespace diff --git a/base/threading/watchdog.cc b/base/threading/watchdog.cc index 878cdc8..5cff254 100644 --- a/base/threading/watchdog.cc +++ b/base/threading/watchdog.cc @@ -21,8 +21,8 @@ namespace { // on alarms from callers that specify old times. // Lock for access of static data... -LazyInstance<Lock, LeakyLazyInstanceTraits<Lock> > g_static_lock( - LINKER_INITIALIZED); +LazyInstance<Lock, LeakyLazyInstanceTraits<Lock> > g_static_lock = + LAZY_INSTANCE_INITIALIZER; // When did we last alarm and get stuck (for a while) in a debugger? TimeTicks g_last_debugged_alarm_time; diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc index 886a547..cf45f24 100644 --- a/base/threading/worker_pool_posix.cc +++ b/base/threading/worker_pool_posix.cc @@ -57,7 +57,8 @@ void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here, pool_->PostTask(from_here, task); } -base::LazyInstance<WorkerPoolImpl> g_lazy_worker_pool(base::LINKER_INITIALIZED); +base::LazyInstance<WorkerPoolImpl> g_lazy_worker_pool = + LAZY_INSTANCE_INITIALIZER; class WorkerThread : public PlatformThread::Delegate { public: diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index 6534159..737c2b3 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -167,7 +167,7 @@ ThreadData::ThreadDataPool* ThreadData::unregistered_thread_data_pool_ = NULL; // static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - ThreadData::list_lock_(base::LINKER_INITIALIZED); + ThreadData::list_lock_ = LAZY_INSTANCE_INITIALIZER; // static ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED; diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index b2c55a6..618b894 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -97,13 +97,13 @@ #endif base::LazyInstance<chrome::ChromeContentBrowserClient> - g_chrome_content_browser_client(base::LINKER_INITIALIZED); + g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<chrome::ChromeContentRendererClient> - g_chrome_content_renderer_client(base::LINKER_INITIALIZED); + g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<chrome::ChromeContentUtilityClient> - g_chrome_content_utility_client(base::LINKER_INITIALIZED); + g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<chrome::ChromeContentPluginClient> - g_chrome_content_plugin_client(base::LINKER_INITIALIZED); + g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER; extern int NaClMain(const content::MainFunctionParams&); extern int ServiceProcessMain(const content::MainFunctionParams&); diff --git a/chrome/browser/automation/automation_resource_message_filter.cc b/chrome/browser/automation/automation_resource_message_filter.cc index ec5ae69..79d98d3 100644 --- a/chrome/browser/automation/automation_resource_message_filter.cc +++ b/chrome/browser/automation/automation_resource_message_filter.cc @@ -24,12 +24,12 @@ using content::BrowserThread; base::LazyInstance<AutomationResourceMessageFilter::RenderViewMap> - AutomationResourceMessageFilter::filtered_render_views_( - base::LINKER_INITIALIZED); + AutomationResourceMessageFilter::filtered_render_views_ = + LAZY_INSTANCE_INITIALIZER; base::LazyInstance<AutomationResourceMessageFilter::CompletionCallbackMap> - AutomationResourceMessageFilter::completion_callback_map_( - base::LINKER_INITIALIZED); + AutomationResourceMessageFilter::completion_callback_map_ = + LAZY_INSTANCE_INITIALIZER; int AutomationResourceMessageFilter::unique_request_id_ = 1; int AutomationResourceMessageFilter::next_completion_callback_id_ = 0; diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index a4cbf7b..6a27400c 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -101,8 +101,8 @@ static const FilePath::CharType kLoginTimes[] = FPL("login-times"); // Name of file collecting logout times. static const char kLogoutTimes[] = "logout-times"; -static base::LazyInstance<BootTimesLoader> g_boot_times_loader( - base::LINKER_INITIALIZED); +static base::LazyInstance<BootTimesLoader> g_boot_times_loader = + LAZY_INSTANCE_INITIALIZER; BootTimesLoader::BootTimesLoader() : backend_(new Backend()), diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 2e676f4..cb66831 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -72,8 +72,8 @@ class MessageLoopObserver : public MessageLoopForUI::Observer { #endif }; -static base::LazyInstance<MessageLoopObserver> g_message_loop_observer( - base::LINKER_INITIALIZED); +static base::LazyInstance<MessageLoopObserver> g_message_loop_observer = + LAZY_INSTANCE_INITIALIZER; ChromeBrowserMainPartsChromeos::ChromeBrowserMainPartsChromeos( const content::MainFunctionParams& parameters) diff --git a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc index 25e9df8..24e656b 100644 --- a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc +++ b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc @@ -87,8 +87,8 @@ class OncNetworkParserTest : public testing::Test { }; // static -base::LazyInstance<ScopedTempDir> OncNetworkParserTest::temp_db_dir_( - base::LINKER_INITIALIZED); +base::LazyInstance<ScopedTempDir> OncNetworkParserTest::temp_db_dir_ = + LAZY_INSTANCE_INITIALIZER; TEST_F(OncNetworkParserTest, TestCreateNetworkWifi1) { std::string test_blob( diff --git a/chrome/browser/chromeos/cros_settings.cc b/chrome/browser/chromeos/cros_settings.cc index 3afc168..9bbb4f9 100644 --- a/chrome/browser/chromeos/cros_settings.cc +++ b/chrome/browser/chromeos/cros_settings.cc @@ -17,8 +17,8 @@ namespace chromeos { -static base::LazyInstance<CrosSettings> g_cros_settings( - base::LINKER_INITIALIZED); +static base::LazyInstance<CrosSettings> g_cros_settings = + LAZY_INSTANCE_INITIALIZER; CrosSettings* CrosSettings::Get() { // TODO(xiyaun): Use real stuff when underlying libcros is ready. diff --git a/chrome/browser/chromeos/extensions/input_method_event_router.cc b/chrome/browser/chromeos/extensions/input_method_event_router.cc index 443128c..18a06f6 100644 --- a/chrome/browser/chromeos/extensions/input_method_event_router.cc +++ b/chrome/browser/chromeos/extensions/input_method_event_router.cc @@ -42,7 +42,7 @@ class InputMethodPrivateExtensionsWhitelist { }; base::LazyInstance<InputMethodPrivateExtensionsWhitelist> - g_input_method_private_extensions_whitelist(base::LINKER_INITIALIZED); + g_input_method_private_extensions_whitelist = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/chromeos/login/ownership_service.cc b/chrome/browser/chromeos/login/ownership_service.cc index 539aa62..ffdcf57 100644 --- a/chrome/browser/chromeos/login/ownership_service.cc +++ b/chrome/browser/chromeos/login/ownership_service.cc @@ -19,8 +19,8 @@ using content::BrowserThread; namespace chromeos { -static base::LazyInstance<OwnershipService> g_ownership_service( - base::LINKER_INITIALIZED); +static base::LazyInstance<OwnershipService> g_ownership_service = + LAZY_INSTANCE_INITIALIZER; // static OwnershipService* OwnershipService::GetSharedInstance() { diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index b9e92fa..5a68498 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -175,8 +175,8 @@ class ScreenLockObserver : public chromeos::ScreenLockLibrary::Observer, DISALLOW_COPY_AND_ASSIGN(ScreenLockObserver); }; -static base::LazyInstance<ScreenLockObserver> g_screen_lock_observer( - base::LINKER_INITIALIZED); +static base::LazyInstance<ScreenLockObserver> g_screen_lock_observer = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/chromeos/login/signed_settings_helper.cc b/chrome/browser/chromeos/login/signed_settings_helper.cc index 0841b40..2c2309d 100644 --- a/chrome/browser/chromeos/login/signed_settings_helper.cc +++ b/chrome/browser/chromeos/login/signed_settings_helper.cc @@ -331,7 +331,7 @@ class SignedSettingsHelperImpl : public SignedSettingsHelper, }; static base::LazyInstance<SignedSettingsHelperImpl> - g_signed_settings_helper_impl(base::LINKER_INITIALIZED); + g_signed_settings_helper_impl = LAZY_INSTANCE_INITIALIZER; SignedSettingsHelperImpl::SignedSettingsHelperImpl() { } diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc index b1d3927..d4d598f 100644 --- a/chrome/browser/chromeos/login/user_manager.cc +++ b/chrome/browser/chromeos/login/user_manager.cc @@ -83,7 +83,7 @@ const int kStubDefaultImageIndex = 0; // Delay betweeen user login and attempt to update user's profile image. const long kProfileImageDownloadDelayMs = 10000; -base::LazyInstance<UserManager> g_user_manager(base::LINKER_INITIALIZED); +base::LazyInstance<UserManager> g_user_manager = LAZY_INSTANCE_INITIALIZER; // Used to handle the asynchronous response of deleting a cryptohome directory. class RemoveAttempt : public CryptohomeLibrary::Delegate { diff --git a/chrome/browser/chromeos/system/udev_info_provider.cc b/chrome/browser/chromeos/system/udev_info_provider.cc index c2f9362b..92a30a7 100644 --- a/chrome/browser/chromeos/system/udev_info_provider.cc +++ b/chrome/browser/chromeos/system/udev_info_provider.cc @@ -44,8 +44,8 @@ class UdevInfoProviderImpl : public UdevInfoProvider { DISALLOW_COPY_AND_ASSIGN(UdevInfoProviderImpl); }; -base::LazyInstance<UdevInfoProviderImpl> g_udev_info_provider( - base::LINKER_INITIALIZED); +base::LazyInstance<UdevInfoProviderImpl> g_udev_info_provider = + LAZY_INSTANCE_INITIALIZER; bool UdevInfoProviderImpl::QueryDeviceProperty(const std::string& sys_path, const std::string& property_name, diff --git a/chrome/browser/chromeos/web_socket_proxy_controller.cc b/chrome/browser/chromeos/web_socket_proxy_controller.cc index 9a494e3..c431b7f 100644 --- a/chrome/browser/chromeos/web_socket_proxy_controller.cc +++ b/chrome/browser/chromeos/web_socket_proxy_controller.cc @@ -96,7 +96,7 @@ class OriginValidator { std::vector<std::string> allowed_origins_; }; -base::LazyInstance<OriginValidator> g_validator(base::LINKER_INITIALIZED); +base::LazyInstance<OriginValidator> g_validator = LAZY_INSTANCE_INITIALIZER; class ProxyTask : public Task { virtual void Run() OVERRIDE; @@ -154,7 +154,7 @@ class ProxyLifetime friend class chromeos::WebSocketProxyController; }; -base::LazyInstance<ProxyLifetime> g_proxy_lifetime(base::LINKER_INITIALIZED); +base::LazyInstance<ProxyLifetime> g_proxy_lifetime = LAZY_INSTANCE_INITIALIZER; void ProxyTask::Run() { LOG(INFO) << "Attempt to run web socket proxy task"; diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc index f77f21c..0f71a642 100644 --- a/chrome/browser/chromeos/wm_ipc.cc +++ b/chrome/browser/chromeos/wm_ipc.cc @@ -74,7 +74,7 @@ bool SetIntArrayProperty(XID xid, } // namespace -static base::LazyInstance<WmIpc> g_wm_ipc(base::LINKER_INITIALIZED); +static base::LazyInstance<WmIpc> g_wm_ipc = LAZY_INSTANCE_INITIALIZER; // static WmIpc* WmIpc::instance() { diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 2aa6dff..09735ce 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -34,8 +34,8 @@ using content::BrowserThread; namespace { typedef std::list<TabSpecificContentSettings*> TabSpecificList; -static base::LazyInstance<TabSpecificList> g_tab_specific( - base::LINKER_INITIALIZED); +static base::LazyInstance<TabSpecificList> g_tab_specific = + LAZY_INSTANCE_INITIALIZER; } bool TabSpecificContentSettings::LocalSharedObjectsContainer::empty() const { diff --git a/chrome/browser/debugger/devtools_file_util.cc b/chrome/browser/debugger/devtools_file_util.cc index 4f6b1db1..7e4158a 100644 --- a/chrome/browser/debugger/devtools_file_util.cc +++ b/chrome/browser/debugger/devtools_file_util.cc @@ -19,7 +19,7 @@ namespace { base::LazyInstance<FilePath, base::LeakyLazyInstanceTraits<FilePath> > - g_last_save_path(base::LINKER_INITIALIZED); + g_last_save_path = LAZY_INSTANCE_INITIALIZER; class SaveAsDialog : public SelectFileDialog::Listener, public base::RefCounted<SaveAsDialog> { diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 21a85cc..e563960 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -109,7 +109,7 @@ class DefaultDownloadDirectory { }; static base::LazyInstance<DefaultDownloadDirectory> - g_default_download_directory(base::LINKER_INITIALIZED); + g_default_download_directory = LAZY_INSTANCE_INITIALIZER; const FilePath& GetDefaultDownloadDirectory() { return g_default_download_directory.Get().path(); diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index c650daa..934bfd7 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -53,7 +53,7 @@ struct Whitelist { }; static base::LazyInstance<Whitelist> - g_whitelisted_install_data(base::LINKER_INITIALIZED); + g_whitelisted_install_data = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/extensions/extension_omnibox_api.cc b/chrome/browser/extensions/extension_omnibox_api.cc index 1590927b..300333e 100644 --- a/chrome/browser/extensions/extension_omnibox_api.cc +++ b/chrome/browser/extensions/extension_omnibox_api.cc @@ -41,7 +41,8 @@ const char kDescriptionStylesOffset[] = "offset"; const char kDescriptionStylesLength[] = "length"; static base::LazyInstance<PropertyAccessor<ExtensionOmniboxSuggestion> > - g_extension_omnibox_suggestion_property_accessor(base::LINKER_INITIALIZED); + g_extension_omnibox_suggestion_property_accessor = + LAZY_INSTANCE_INITIALIZER; PropertyAccessor<ExtensionOmniboxSuggestion>& GetPropertyAccessor() { return g_extension_omnibox_suggestion_property_accessor.Get(); diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc index 0cc2d01..d80b898 100644 --- a/chrome/browser/extensions/extension_webnavigation_api.cc +++ b/chrome/browser/extensions/extension_webnavigation_api.cc @@ -29,8 +29,8 @@ namespace { typedef std::map<TabContents*, ExtensionWebNavigationTabObserver*> TabObserverMap; -static base::LazyInstance<TabObserverMap> g_tab_observer( - base::LINKER_INITIALIZED); +static base::LazyInstance<TabObserverMap> g_tab_observer = + LAZY_INSTANCE_INITIALIZER; // URL schemes for which we'll send events. const char* kValidSchemes[] = { diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index f324298..bf504a6 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -121,7 +121,7 @@ class ExternalTabPageInfoBubbleView : public PageInfoBubbleView { }; base::LazyInstance<ExternalTabContainer::PendingTabs> - ExternalTabContainer::pending_tabs_(base::LINKER_INITIALIZED); + ExternalTabContainer::pending_tabs_ = LAZY_INSTANCE_INITIALIZER; ExternalTabContainer::ExternalTabContainer( AutomationProvider* automation, AutomationResourceMessageFilter* filter) diff --git a/chrome/browser/internal_auth.cc b/chrome/browser/internal_auth.cc index 0730661..cd7216e 100644 --- a/chrome/browser/internal_auth.cc +++ b/chrome/browser/internal_auth.cc @@ -325,10 +325,10 @@ class InternalAuthVerificationService { namespace { static base::LazyInstance<browser::InternalAuthVerificationService> - g_verification_service(base::LINKER_INITIALIZED); + g_verification_service = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_verification_service_lock(base::LINKER_INITIALIZED); + g_verification_service_lock = LAZY_INSTANCE_INITIALIZER; } // namespace @@ -433,7 +433,7 @@ class InternalAuthGenerationService : public base::ThreadChecker { namespace { static base::LazyInstance<browser::InternalAuthGenerationService> - g_generation_service(base::LINKER_INITIALIZED); + g_generation_service = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/plugin_prefs.cc b/chrome/browser/plugin_prefs.cc index f4923f1..576204f 100644 --- a/chrome/browser/plugin_prefs.cc +++ b/chrome/browser/plugin_prefs.cc @@ -41,8 +41,8 @@ namespace { // Default state for a plug-in (not state of the default plug-in!). // Accessed only on the UI thread. -base::LazyInstance<std::map<FilePath, bool> > g_default_plugin_state( - base::LINKER_INITIALIZED); +base::LazyInstance<std::map<FilePath, bool> > g_default_plugin_state = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc index 8958dba..ddcf209 100644 --- a/chrome/browser/printing/printing_message_filter.cc +++ b/chrome/browser/printing/printing_message_filter.cc @@ -40,7 +40,7 @@ struct PrintingSequencePathMap { // No locking, only access on the FILE thread. static base::LazyInstance<PrintingSequencePathMap> - g_printing_file_descriptor_map(base::LINKER_INITIALIZED); + g_printing_file_descriptor_map = LAZY_INSTANCE_INITIALIZER; #endif void RenderParamsFromPrintSettings(const printing::PrintSettings& settings, diff --git a/chrome/browser/resources_util.cc b/chrome/browser/resources_util.cc index a11181e..a406b4d 100644 --- a/chrome/browser/resources_util.cc +++ b/chrome/browser/resources_util.cc @@ -41,7 +41,7 @@ class ThemeMap { StringIntMap id_map_; }; -static base::LazyInstance<ThemeMap> g_theme_ids(base::LINKER_INITIALIZED); +static base::LazyInstance<ThemeMap> g_theme_ids = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc index 2b4a305..9455d90 100644 --- a/chrome/browser/safe_browsing/malware_details.cc +++ b/chrome/browser/safe_browsing/malware_details.cc @@ -54,7 +54,7 @@ class MalwareDetailsFactoryImpl }; static base::LazyInstance<MalwareDetailsFactoryImpl> - g_malware_details_factory_impl(base::LINKER_INITIALIZED); + g_malware_details_factory_impl = LAZY_INSTANCE_INITIALIZER; // Create a MalwareDetails for the given tab. /* static */ diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 7e13c1d..33eedbc 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -102,7 +102,7 @@ static const char* const kBoxChecked = "boxchecked"; SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; static base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap> - g_unsafe_resource_map(base::LINKER_INITIALIZED); + g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER; // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we // don't leak it. @@ -127,7 +127,7 @@ class SafeBrowsingBlockingPageFactoryImpl }; static base::LazyInstance<SafeBrowsingBlockingPageFactoryImpl> - g_safe_browsing_blocking_page_factory_impl(base::LINKER_INITIALIZED); + g_safe_browsing_blocking_page_factory_impl = LAZY_INSTANCE_INITIALIZER; SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( SafeBrowsingService* sb_service, diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 2222296..2374ca4 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -101,7 +101,7 @@ class SafeBrowsingServiceFactoryImpl : public SafeBrowsingServiceFactory { }; static base::LazyInstance<SafeBrowsingServiceFactoryImpl> - g_safe_browsing_service_factory_impl(base::LINKER_INITIALIZED); + g_safe_browsing_service_factory_impl = LAZY_INSTANCE_INITIALIZER; struct SafeBrowsingService::WhiteListedEntry { int render_process_host_id; diff --git a/chrome/browser/speech/speech_input_bubble.cc b/chrome/browser/speech/speech_input_bubble.cc index 668915a..edf4414 100644 --- a/chrome/browser/speech/speech_input_bubble.cc +++ b/chrome/browser/speech/speech_input_bubble.cc @@ -98,7 +98,8 @@ SpeechInputBubbleImages::SpeechInputBubbleImages() { } } -base::LazyInstance<SpeechInputBubbleImages> g_images(base::LINKER_INITIALIZED); +base::LazyInstance<SpeechInputBubbleImages> g_images = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/speech/speech_input_extension_notification.cc b/chrome/browser/speech/speech_input_extension_notification.cc index 8dd92a4..6a07a46 100644 --- a/chrome/browser/speech/speech_input_extension_notification.cc +++ b/chrome/browser/speech/speech_input_extension_notification.cc @@ -52,7 +52,7 @@ NotificationTrayImages::NotificationTrayImages() { IDR_SPEECH_INPUT_TRAY_BALLOON_ICON); } -base::LazyInstance<NotificationTrayImages> g_images(base::LINKER_INITIALIZED); +base::LazyInstance<NotificationTrayImages> g_images = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/spellchecker/spellcheck_profile.cc b/chrome/browser/spellchecker/spellcheck_profile.cc index ecb6cb9..9af9a1e 100644 --- a/chrome/browser/spellchecker/spellcheck_profile.cc +++ b/chrome/browser/spellchecker/spellcheck_profile.cc @@ -18,8 +18,8 @@ using content::BrowserThread; namespace { -base::LazyInstance<SpellCheckProfile::CustomWordList> g_empty_list( - base::LINKER_INITIALIZED); +base::LazyInstance<SpellCheckProfile::CustomWordList> g_empty_list = + LAZY_INSTANCE_INITIALIZER; } // namespace SpellCheckProfile::SpellCheckProfile(const FilePath& profile_dir) diff --git a/chrome/browser/sync/util/sqlite_utils.cc b/chrome/browser/sync/util/sqlite_utils.cc index 725fd8d..4cb6c4e 100644 --- a/chrome/browser/sync/util/sqlite_utils.cc +++ b/chrome/browser/sync/util/sqlite_utils.cc @@ -80,7 +80,7 @@ class DefaultSQLErrorHandlerFactory : public SQLErrorHandlerFactory { }; static base::LazyInstance<DefaultSQLErrorHandlerFactory> - g_default_sql_error_handler_factory(base::LINKER_INITIALIZED); + g_default_sql_error_handler_factory = LAZY_INSTANCE_INITIALIZER; SQLErrorHandlerFactory* GetErrorHandlerFactory() { // TODO(cpu): Testing needs to override the error handler. diff --git a/chrome/browser/tabs/pinned_tab_service_factory.cc b/chrome/browser/tabs/pinned_tab_service_factory.cc index 5b2e7ac..70407ad 100644 --- a/chrome/browser/tabs/pinned_tab_service_factory.cc +++ b/chrome/browser/tabs/pinned_tab_service_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/profiles/profile_dependency_manager.h" namespace { -base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory( - base::LINKER_INITIALIZED); +base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory = + LAZY_INSTANCE_INITIALIZER; } // static diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index ac21d38..ad4cbc4 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -141,7 +141,7 @@ const char* const TranslateManager::kTargetLanguagesKey = "tl"; // static base::LazyInstance<std::set<std::string> > - TranslateManager::supported_languages_(base::LINKER_INITIALIZED); + TranslateManager::supported_languages_ = LAZY_INSTANCE_INITIALIZER; TranslateManager::~TranslateManager() { weak_method_factory_.InvalidateWeakPtrs(); diff --git a/chrome/browser/ui/cocoa/view_id_util.mm b/chrome/browser/ui/cocoa/view_id_util.mm index f3396a9..691c7f3 100644 --- a/chrome/browser/ui/cocoa/view_id_util.mm +++ b/chrome/browser/ui/cocoa/view_id_util.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,7 +21,7 @@ namespace { // rather than using a separated map. typedef std::map<NSView*, ViewID> ViewIDMap; -static base::LazyInstance<ViewIDMap> g_view_id_map(base::LINKER_INITIALIZED); +static base::LazyInstance<ViewIDMap> g_view_id_map = LAZY_INSTANCE_INITIALIZER; // Returns the view's nearest descendant (including itself) with a specific // ViewID, or nil if no subview has that ViewID. diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc index 7dd7155..b856cda 100644 --- a/chrome/browser/ui/panels/panel_manager.cc +++ b/chrome/browser/ui/panels/panel_manager.cc @@ -51,7 +51,7 @@ const int kMillisecondsBeforeCollapsingFromTitleOnlyState = 0; // static PanelManager* PanelManager::GetInstance() { - static base::LazyInstance<PanelManager> instance(base::LINKER_INITIALIZED); + static base::LazyInstance<PanelManager> instance = LAZY_INSTANCE_INITIALIZER; return instance.Pointer(); } diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index 110f29e..eb0f311 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -65,7 +65,7 @@ namespace { static base::LazyInstance<PropertyAccessor<TabContentsWrapper*> > - g_tab_contents_wrapper_property_accessor(base::LINKER_INITIALIZED); + g_tab_contents_wrapper_property_accessor = LAZY_INSTANCE_INITIALIZER; // The list of prefs we want to observe. const char* kPrefsToObserve[] = { diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc index 1c9b1dd..f05a8f1 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc @@ -416,7 +416,7 @@ void PaintPatcher::DerefPatch() { } } -base::LazyInstance<PaintPatcher> g_paint_patcher(base::LINKER_INITIALIZED); +base::LazyInstance<PaintPatcher> g_paint_patcher = LAZY_INSTANCE_INITIALIZER; // twips are a unit of type measurement, and RichEdit controls use them // to set offsets. diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc index edf75b8..a226188 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc @@ -86,7 +86,7 @@ class ChromeURLContentSecurityPolicyExceptionSet }; base::LazyInstance<ChromeURLContentSecurityPolicyExceptionSet> - g_chrome_url_content_security_policy_exceptions(base::LINKER_INITIALIZED); + g_chrome_url_content_security_policy_exceptions = LAZY_INSTANCE_INITIALIZER; // Parse a URL into the components used to resolve its request. |source_name| // is the hostname and |path| is the remaining portion of the URL. diff --git a/chrome/browser/ui/webui/constrained_html_ui.cc b/chrome/browser/ui/webui/constrained_html_ui.cc index bfb989f1..c0a5b84 100644 --- a/chrome/browser/ui/webui/constrained_html_ui.cc +++ b/chrome/browser/ui/webui/constrained_html_ui.cc @@ -18,7 +18,7 @@ #include "content/public/browser/notification_service.h" static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> > - g_constrained_html_ui_property_accessor(base::LINKER_INITIALIZED); + g_constrained_html_ui_property_accessor = LAZY_INSTANCE_INITIALIZER; ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents) : ChromeWebUI(contents) { diff --git a/chrome/browser/ui/webui/html_dialog_ui.cc b/chrome/browser/ui/webui/html_dialog_ui.cc index 3f367f4..4d5b678 100644 --- a/chrome/browser/ui/webui/html_dialog_ui.cc +++ b/chrome/browser/ui/webui/html_dialog_ui.cc @@ -15,7 +15,7 @@ #include "content/public/common/bindings_policy.h" static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> > - g_html_dialog_ui_property_accessor(base::LINKER_INITIALIZED); + g_html_dialog_ui_property_accessor = LAZY_INSTANCE_INITIALIZER; HtmlDialogUI::HtmlDialogUI(TabContents* tab_contents) : ChromeWebUI(tab_contents) { diff --git a/chrome/browser/ui/webui/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview_ui.cc index fc7684e4..818e90a 100644 --- a/chrome/browser/ui/webui/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview_ui.cc @@ -62,7 +62,7 @@ class PrintPreviewRequestIdMapWithLock { // Written to on the UI thread, read from any thread. base::LazyInstance<PrintPreviewRequestIdMapWithLock> - g_print_preview_request_id_map(base::LINKER_INITIALIZED); + g_print_preview_request_id_map = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc index 2c84f2df..c1d4377 100644 --- a/chrome/browser/ui/webui/web_ui_browsertest.cc +++ b/chrome/browser/ui/webui/web_ui_browsertest.cc @@ -31,8 +31,8 @@ namespace { const FilePath::CharType kMockJS[] = FILE_PATH_LITERAL("mock4js.js"); const FilePath::CharType kWebUILibraryJS[] = FILE_PATH_LITERAL("test_api.js"); const FilePath::CharType kWebUITestFolder[] = FILE_PATH_LITERAL("webui"); -base::LazyInstance<std::vector<std::string> > error_messages_( - base::LINKER_INITIALIZED); +base::LazyInstance<std::vector<std::string> > error_messages_ = + LAZY_INSTANCE_INITIALIZER; // Intercepts all log messages. bool LogHandler(int severity, @@ -227,8 +227,8 @@ class MockWebUIProvider : public TestChromeWebUIFactory::WebUIProvider { } }; -base::LazyInstance<MockWebUIProvider> mock_provider_( - base::LINKER_INITIALIZED); +base::LazyInstance<MockWebUIProvider> mock_provider_ = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/common/extensions/extension_message_bundle.cc b/chrome/common/extensions/extension_message_bundle.cc index ea45721..6b6f5b2 100644 --- a/chrome/common/extensions/extension_message_bundle.cc +++ b/chrome/common/extensions/extension_message_bundle.cc @@ -325,8 +325,8 @@ struct ExtensionToMessagesMap { ExtensionToL10nMessagesMap messages_map; }; -static base::LazyInstance<ExtensionToMessagesMap> g_extension_to_messages_map( - base::LINKER_INITIALIZED); +static base::LazyInstance<ExtensionToMessagesMap> g_extension_to_messages_map = + LAZY_INSTANCE_INITIALIZER; ExtensionToMessagesMap::ExtensionToMessagesMap() {} diff --git a/chrome/common/profiling.cc b/chrome/common/profiling.cc index 1a56086..9422a90 100644 --- a/chrome/common/profiling.cc +++ b/chrome/common/profiling.cc @@ -91,7 +91,7 @@ class ProfilingThreadControl { base::LazyInstance<ProfilingThreadControl, base::LeakyLazyInstanceTraits<ProfilingThreadControl> > - g_flush_thread_control(base::LINKER_INITIALIZED); + g_flush_thread_control = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/common/time_format.cc b/chrome/common/time_format.cc index 8ce4b25..d11b7ab 100644 --- a/chrome/common/time_format.cc +++ b/chrome/common/time_format.cc @@ -181,8 +181,8 @@ class TimeFormatter { DISALLOW_COPY_AND_ASSIGN(TimeFormatter); }; -static base::LazyInstance<TimeFormatter> g_time_formatter( - base::LINKER_INITIALIZED); +static base::LazyInstance<TimeFormatter> g_time_formatter = + LAZY_INSTANCE_INITIALIZER; void TimeFormatter::BuildFormats( FormatType format_type, std::vector<icu::PluralFormat*>* time_formats) { diff --git a/chrome/default_plugin/install_dialog.cc b/chrome/default_plugin/install_dialog.cc index 6462387..0ae91cf 100644 --- a/chrome/default_plugin/install_dialog.cc +++ b/chrome/default_plugin/install_dialog.cc @@ -14,7 +14,7 @@ #include "webkit/glue/webkit_glue.h" typedef base::hash_map<const std::wstring, PluginInstallDialog*> DialogMap; -base::LazyInstance<DialogMap> s_dialogs(base::LINKER_INITIALIZED); +base::LazyInstance<DialogMap> s_dialogs = LAZY_INSTANCE_INITIALIZER; PluginInstallDialog* PluginInstallDialog::AddInstaller( PluginInstallerImpl* plugin_impl, const std::wstring& plugin_name) { diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc index e3f344e..cce0d2f 100644 --- a/chrome/installer/util/master_preferences.cc +++ b/chrome/installer/util/master_preferences.cc @@ -20,8 +20,8 @@ namespace { const char kDistroDict[] = "distribution"; const char kFirstRunTabs[] = "first_run_tabs"; -base::LazyInstance<installer::MasterPreferences> g_master_preferences( - base::LINKER_INITIALIZED); +base::LazyInstance<installer::MasterPreferences> g_master_preferences = + LAZY_INSTANCE_INITIALIZER; bool GetGURLFromValue(const Value* in_value, GURL* out_value) { if (!in_value || !out_value) diff --git a/chrome/renderer/extensions/chrome_v8_extension.cc b/chrome/renderer/extensions/chrome_v8_extension.cc index 95a9fb8..1320a86 100644 --- a/chrome/renderer/extensions/chrome_v8_extension.cc +++ b/chrome/renderer/extensions/chrome_v8_extension.cc @@ -32,10 +32,10 @@ const char kValidateCallbacks[] = "validateCallbacks"; #endif typedef std::map<int, std::string> StringMap; -static base::LazyInstance<StringMap> g_string_map(base::LINKER_INITIALIZED); +static base::LazyInstance<StringMap> g_string_map = LAZY_INSTANCE_INITIALIZER; -static base::LazyInstance<ChromeV8Extension::InstanceSet> g_instances( - base::LINKER_INITIALIZED); +static base::LazyInstance<ChromeV8Extension::InstanceSet> g_instances = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome/renderer/extensions/chrome_webstore_bindings.cc b/chrome/renderer/extensions/chrome_webstore_bindings.cc index d5e0a6c..9f8ed4f 100644 --- a/chrome/renderer/extensions/chrome_webstore_bindings.cc +++ b/chrome/renderer/extensions/chrome_webstore_bindings.cc @@ -50,10 +50,10 @@ const char kInvalidWebstoreItemUrlError[] = // (successful or not) via HandleInstallResponse. int g_next_install_id = 0; -base::LazyInstance<WeakV8FunctionMap> g_success_callbacks( - base::LINKER_INITIALIZED); -base::LazyInstance<WeakV8FunctionMap> g_failure_callbacks( - base::LINKER_INITIALIZED); +base::LazyInstance<WeakV8FunctionMap> g_success_callbacks = + LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<WeakV8FunctionMap> g_failure_callbacks = + LAZY_INSTANCE_INITIALIZER; } // anonymous namespace diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc index deb0180..00501b7 100644 --- a/chrome/renderer/extensions/event_bindings.cc +++ b/chrome/renderer/extensions/event_bindings.cc @@ -46,8 +46,8 @@ struct SingletonData { std::map<std::string, EventListenerCounts> listener_counts_; }; -static base::LazyInstance<SingletonData> g_singleton_data( - base::LINKER_INITIALIZED); +static base::LazyInstance<SingletonData> g_singleton_data = + LAZY_INSTANCE_INITIALIZER; static EventListenerCounts& GetListenerCounts(const std::string& extension_id) { return g_singleton_data.Get().listener_counts_[extension_id]; diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc index 878aaf7..119590e 100644 --- a/chrome/renderer/extensions/extension_helper.cc +++ b/chrome/renderer/extensions/extension_helper.cc @@ -47,7 +47,8 @@ namespace { // document to another with adoptNode, and so having the object be a // RenderViewObserver means it might miss some notifications after it moves. typedef std::map<WebFrame*, UserScriptIdleScheduler*> SchedulerMap; -static base::LazyInstance<SchedulerMap> g_schedulers(base::LINKER_INITIALIZED); +static base::LazyInstance<SchedulerMap> g_schedulers = + LAZY_INSTANCE_INITIALIZER; } ExtensionHelper::ExtensionHelper(content::RenderView* render_view, diff --git a/chrome/renderer/extensions/miscellaneous_bindings.cc b/chrome/renderer/extensions/miscellaneous_bindings.cc index 46b84c9..e118608 100644 --- a/chrome/renderer/extensions/miscellaneous_bindings.cc +++ b/chrome/renderer/extensions/miscellaneous_bindings.cc @@ -45,8 +45,8 @@ struct ExtensionData { std::map<int, PortData> ports; // port ID -> data }; -static base::LazyInstance<ExtensionData> g_extension_data( - base::LINKER_INITIALIZED); +static base::LazyInstance<ExtensionData> g_extension_data = + LAZY_INSTANCE_INITIALIZER; static bool HasPortData(int port_id) { return g_extension_data.Get().ports.find(port_id) != diff --git a/chrome/renderer/extensions/schema_generated_bindings.cc b/chrome/renderer/extensions/schema_generated_bindings.cc index e85e4a3..902b160 100644 --- a/chrome/renderer/extensions/schema_generated_bindings.cc +++ b/chrome/renderer/extensions/schema_generated_bindings.cc @@ -79,8 +79,8 @@ struct PendingRequest { }; typedef std::map<int, linked_ptr<PendingRequest> > PendingRequestMap; -base::LazyInstance<PendingRequestMap> g_pending_requests( - base::LINKER_INITIALIZED); +base::LazyInstance<PendingRequestMap> g_pending_requests = + LAZY_INSTANCE_INITIALIZER; // A RenderViewVisitor class that iterates through the set of available // views, looking for a view of the given type, in the given browser window diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc index 8d18284..9a224fa 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc @@ -37,10 +37,10 @@ static GURL StripRef(const GURL& url) { typedef std::set<PhishingClassifierDelegate*> PhishingClassifierDelegates; static base::LazyInstance<PhishingClassifierDelegates> - g_delegates(base::LINKER_INITIALIZED); + g_delegates = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<scoped_ptr<const safe_browsing::Scorer> > - g_phishing_scorer(base::LINKER_INITIALIZED); + g_phishing_scorer = LAZY_INSTANCE_INITIALIZER; // static PhishingClassifierFilter* PhishingClassifierFilter::Create() { diff --git a/chrome/service/cloud_print/cloud_print_token_store.cc b/chrome/service/cloud_print/cloud_print_token_store.cc index e0bb0b0..dacbf94 100644 --- a/chrome/service/cloud_print/cloud_print_token_store.cc +++ b/chrome/service/cloud_print/cloud_print_token_store.cc @@ -10,7 +10,7 @@ // Keep the global CloudPrintTokenStore in a TLS slot so it is impossible to // incorrectly from the wrong thread. static base::LazyInstance<base::ThreadLocalPointer<CloudPrintTokenStore> > - lazy_tls(base::LINKER_INITIALIZED); + lazy_tls = LAZY_INSTANCE_INITIALIZER; CloudPrintTokenStore* CloudPrintTokenStore::current() { return lazy_tls.Pointer()->Get(); diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 4f6c57c..fcc2e50 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -505,7 +505,7 @@ bool ProxyFactory::ReleaseAutomationServer(void* server_id, static base::LazyInstance<ProxyFactory, base::LeakyLazyInstanceTraits<ProxyFactory> > - g_proxy_factory(base::LINKER_INITIALIZED); + g_proxy_factory = LAZY_INSTANCE_INITIALIZER; template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { static void RetainCallee(ChromeFrameAutomationClient* obj) {} diff --git a/chrome_frame/com_type_info_holder.cc b/chrome_frame/com_type_info_holder.cc index aa9b13b..dd71ec0 100644 --- a/chrome_frame/com_type_info_holder.cc +++ b/chrome_frame/com_type_info_holder.cc @@ -11,7 +11,7 @@ extern "C" IMAGE_DOS_HEADER __ImageBase; namespace com_util { -base::LazyInstance<TypeInfoCache> type_info_cache(base::LINKER_INITIALIZED); +base::LazyInstance<TypeInfoCache> type_info_cache = LAZY_INSTANCE_INITIALIZER; // TypeInfoCache diff --git a/chrome_frame/crash_reporting/crash_metrics.cc b/chrome_frame/crash_reporting/crash_metrics.cc index 8a103f1..fb59aa8 100644 --- a/chrome_frame/crash_reporting/crash_metrics.cc +++ b/chrome_frame/crash_reporting/crash_metrics.cc @@ -12,7 +12,7 @@ static const wchar_t kChromeFrameMetricsKey[] = L"Software\\Google\\ChromeFrameMetrics"; base::LazyInstance<CrashMetricsReporter> - g_crash_metrics_instance_(base::LINKER_INITIALIZED); + g_crash_metrics_instance_ = LAZY_INSTANCE_INITIALIZER; wchar_t* CrashMetricsReporter::g_metric_names[LAST_METRIC] = { L"navigationcount", diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc index 0e5b044..797a2ab 100644 --- a/chrome_frame/external_tab.cc +++ b/chrome_frame/external_tab.cc @@ -15,8 +15,8 @@ DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate); namespace { - static base::LazyInstance<ChromeProxyFactory> g_proxy_factory( - base::LINKER_INITIALIZED); + static base::LazyInstance<ChromeProxyFactory> g_proxy_factory = + LAZY_INSTANCE_INITIALIZER; struct UserDataHolder : public SyncMessageContext { explicit UserDataHolder(void* p) : data(p) {} diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index 9af220b..27d453e 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -78,13 +78,13 @@ static const int kInitialUMAUploadTimeoutMilliSeconds = 30000; static const int kMinMilliSecondsPerUMAUpload = 600000; base::LazyInstance<base::ThreadLocalPointer<MetricsService> > - MetricsService::g_metrics_instance_(base::LINKER_INITIALIZED); + MetricsService::g_metrics_instance_ = LAZY_INSTANCE_INITIALIZER; base::Lock MetricsService::metrics_service_lock_; // Initialize histogram statistics gathering system. base::LazyInstance<base::StatisticsRecorder> - g_statistics_recorder_(base::LINKER_INITIALIZED); + g_statistics_recorder_ = LAZY_INSTANCE_INITIALIZER; // This class provides functionality to upload the ChromeFrame UMA data to the // server. An instance of this class is created whenever we have data to be diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index b597289..bce7023 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -136,15 +136,15 @@ class FakeBrowserProcessImpl : public BrowserProcessImpl { }; base::LazyInstance<chrome::ChromeContentClient> - g_chrome_content_client(base::LINKER_INITIALIZED); + g_chrome_content_client = LAZY_INSTANCE_INITIALIZER; // Override the default ContentBrowserClient to let Chrome participate in // content logic. Must be done before any tabs are created. base::LazyInstance<chrome::ChromeContentBrowserClient> - g_browser_client(base::LINKER_INITIALIZED); + g_browser_client = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<chrome::ChromeContentRendererClient> - g_renderer_client(base::LINKER_INITIALIZED); + g_renderer_client = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc index 0f5ea5a..753d265 100644 --- a/chrome_frame/urlmon_moniker.cc +++ b/chrome_frame/urlmon_moniker.cc @@ -23,7 +23,7 @@ static const int kMonikerBindToObject = 8; static const int kMonikerBindToStorage = kMonikerBindToObject + 1; base::LazyInstance<base::ThreadLocalPointer<NavigationManager> > - NavigationManager::thread_singleton_(base::LINKER_INITIALIZED); + NavigationManager::thread_singleton_ = LAZY_INSTANCE_INITIALIZER; BEGIN_VTABLE_PATCHES(IMoniker) VTABLE_PATCH_ENTRY(kMonikerBindToObject, MonikerPatch::BindToObject) diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 7cb2b14..f6a74b7 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -110,7 +110,7 @@ namespace { // pointer so it should not be dereferenced and used for comparison against a // living instance only. base::LazyInstance<base::ThreadLocalPointer<IBrowserService> > - g_tls_browser_for_cf_navigation(base::LINKER_INITIALIZED); + g_tls_browser_for_cf_navigation = LAZY_INSTANCE_INITIALIZER; } // end anonymous namespace diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc index 7666842..5327c1d 100644 --- a/content/browser/browser_child_process_host.cc +++ b/content/browser/browser_child_process_host.cc @@ -35,8 +35,8 @@ using content::BrowserThread; namespace { typedef std::list<BrowserChildProcessHost*> ChildProcessList; -static base::LazyInstance<ChildProcessList> g_child_process_list( - base::LINKER_INITIALIZED); +static base::LazyInstance<ChildProcessList> g_child_process_list = + LAZY_INSTANCE_INITIALIZER; // The NotificationTask is used to notify about plugin process connection/ // disconnection. It is needed because the notifications in the diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index d964af0..023259b 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -36,7 +36,7 @@ namespace { // without holding this lock. Do not block while holding this lock. base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_lock(base::LINKER_INITIALIZED); + g_lock = LAZY_INSTANCE_INITIALIZER; // An array of the BrowserThread objects. This array is protected by |g_lock|. diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc index eec9d8d..6ba5a39 100644 --- a/content/browser/browsing_instance.cc +++ b/content/browser/browsing_instance.cc @@ -17,7 +17,8 @@ base::LazyInstance< BrowsingInstance::ContextSiteInstanceMap, base::LeakyLazyInstanceTraits<BrowsingInstance::ContextSiteInstanceMap> > - BrowsingInstance::context_site_instance_map_(base::LINKER_INITIALIZED); + BrowsingInstance::context_site_instance_map_ = + LAZY_INSTANCE_INITIALIZER; BrowsingInstance::BrowsingInstance(content::BrowserContext* browser_context) : browser_context_(browser_context) { diff --git a/content/browser/debugger/devtools_client_host.cc b/content/browser/debugger/devtools_client_host.cc index 3250dc8..3ff2c54 100644 --- a/content/browser/debugger/devtools_client_host.cc +++ b/content/browser/debugger/devtools_client_host.cc @@ -13,7 +13,7 @@ typedef std::vector<DevToolsClientHost*> DevToolsClientHostList; namespace { base::LazyInstance<DevToolsClientHostList, base::LeakyLazyInstanceTraits<DevToolsClientHostList> > - g_instances(base::LINKER_INITIALIZED); + g_instances = LAZY_INSTANCE_INITIALIZER; } // namespace // static diff --git a/content/browser/debugger/devtools_http_protocol_handler.cc b/content/browser/debugger/devtools_http_protocol_handler.cc index 4d654d2..61b96e2 100644 --- a/content/browser/debugger/devtools_http_protocol_handler.cc +++ b/content/browser/debugger/devtools_http_protocol_handler.cc @@ -136,11 +136,11 @@ class TabContentsIDHelper : public TabContentsObserver { base::LazyInstance< TabContentsIDHelper::IdToTabContentsMap, base::LeakyLazyInstanceTraits<TabContentsIDHelper::IdToTabContentsMap> > - TabContentsIDHelper::id_to_tabcontents_(base::LINKER_INITIALIZED); + TabContentsIDHelper::id_to_tabcontents_ = LAZY_INSTANCE_INITIALIZER; base::LazyInstance< TabContentsIDHelper::TabContentsToIdMap, base::LeakyLazyInstanceTraits<TabContentsIDHelper::TabContentsToIdMap> > - TabContentsIDHelper::tabcontents_to_id_(base::LINKER_INITIALIZED); + TabContentsIDHelper::tabcontents_to_id_ = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/browser/debugger/render_view_devtools_agent_host.cc b/content/browser/debugger/render_view_devtools_agent_host.cc index 8985b67..99dc4d0 100644 --- a/content/browser/debugger/render_view_devtools_agent_host.cc +++ b/content/browser/debugger/render_view_devtools_agent_host.cc @@ -22,7 +22,7 @@ typedef std::map<RenderViewHost*, RenderViewDevToolsAgentHost*> Instances; namespace { base::LazyInstance<Instances, base::LeakyLazyInstanceTraits<Instances> > - g_instances(base::LINKER_INITIALIZED); + g_instances = LAZY_INSTANCE_INITIALIZER; } // namespace DevToolsAgentHost* RenderViewDevToolsAgentHost::FindFor( diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 5e7cb43..c7b952b 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -49,8 +49,8 @@ enum GPUProcessLifetimeEvent { }; // A global map from GPU process host ID to GpuProcessHost. -static base::LazyInstance<IDMap<GpuProcessHost> > g_hosts_by_id( - base::LINKER_INITIALIZED); +static base::LazyInstance<IDMap<GpuProcessHost> > g_hosts_by_id = + LAZY_INSTANCE_INITIALIZER; // Number of times the gpu process has crashed in the current browser session. static int g_gpu_crash_count = 0; @@ -593,7 +593,6 @@ bool GpuProcessHost::LaunchGpuProcess() { switches::kGpuStartupDialog, switches::kLoggingLevel, switches::kNoSandbox, - switches::kTraceStartup, }; cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, arraysize(kSwitchNames)); diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index d6f9830..de484b3 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -35,8 +35,8 @@ namespace { #undef DestroyAll #endif -base::LazyInstance<IDMap<GpuProcessHostUIShim> > g_hosts_by_id( - base::LINKER_INITIALIZED); +base::LazyInstance<IDMap<GpuProcessHostUIShim> > g_hosts_by_id = + LAZY_INSTANCE_INITIALIZER; class SendOnIOThreadTask : public Task { public: diff --git a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc index 7a50f3a..7580c18 100644 --- a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc +++ b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc @@ -108,8 +108,8 @@ class KeyUtilityClientImpl // IndexedDBKeyUtilityClient definitions. -static base::LazyInstance<IndexedDBKeyUtilityClient> client_instance( - base::LINKER_INITIALIZED); +static base::LazyInstance<IndexedDBKeyUtilityClient> client_instance = + LAZY_INSTANCE_INITIALIZER; IndexedDBKeyUtilityClient::IndexedDBKeyUtilityClient() : is_shutdown_(false) { diff --git a/content/browser/mock_resource_context.cc b/content/browser/mock_resource_context.cc index 2406273..3d8b4dd 100644 --- a/content/browser/mock_resource_context.cc +++ b/content/browser/mock_resource_context.cc @@ -10,7 +10,7 @@ namespace content { static base::LazyInstance<MockResourceContext> - g_mock_resource_context(base::LINKER_INITIALIZED); + g_mock_resource_context = LAZY_INSTANCE_INITIALIZER; MockResourceContext* MockResourceContext::GetInstance() { return &g_mock_resource_context.Get(); diff --git a/content/browser/net/url_request_slow_download_job.cc b/content/browser/net/url_request_slow_download_job.cc index 562bb06..bb650f8 100644 --- a/content/browser/net/url_request_slow_download_job.cc +++ b/content/browser/net/url_request_slow_download_job.cc @@ -32,7 +32,8 @@ const int URLRequestSlowDownloadJob::kSecondDownloadSize = 1024 * 10; base::LazyInstance< URLRequestSlowDownloadJob::SlowJobsSet, base::LeakyLazyInstanceTraits<URLRequestSlowDownloadJob::SlowJobsSet> > - URLRequestSlowDownloadJob::pending_requests_(base::LINKER_INITIALIZED); + URLRequestSlowDownloadJob::pending_requests_ = + LAZY_INSTANCE_INITIALIZER; void URLRequestSlowDownloadJob::Start() { MessageLoop::current()->PostTask( diff --git a/content/browser/notification_service_impl.cc b/content/browser/notification_service_impl.cc index 795cb30..221a883 100644 --- a/content/browser/notification_service_impl.cc +++ b/content/browser/notification_service_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ #include "content/public/browser/notification_types.h" static base::LazyInstance<base::ThreadLocalPointer<NotificationServiceImpl> > - lazy_tls_ptr(base::LINKER_INITIALIZED); + lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER; // static NotificationServiceImpl* NotificationServiceImpl::current() { diff --git a/content/browser/renderer_host/image_transport_client.cc b/content/browser/renderer_host/image_transport_client.cc index 7ced869..0235b96 100644 --- a/content/browser/renderer_host/image_transport_client.cc +++ b/content/browser/renderer_host/image_transport_client.cc @@ -216,8 +216,8 @@ class ImageTransportClientGLX : public ImageTransportClient { static base::LazyInstance<GLXFBConfig> fbconfig_; }; -base::LazyInstance<GLXFBConfig> ImageTransportClientGLX::fbconfig_( - base::LINKER_INITIALIZED); +base::LazyInstance<GLXFBConfig> ImageTransportClientGLX::fbconfig_ = + LAZY_INSTANCE_INITIALIZER; class ImageTransportClientOSMesa : public ImageTransportClient { public: diff --git a/content/browser/renderer_host/java/java_bridge_channel_host.cc b/content/browser/renderer_host/java/java_bridge_channel_host.cc index d8476c8..1d21413 100644 --- a/content/browser/renderer_host/java/java_bridge_channel_host.cc +++ b/content/browser/renderer_host/java/java_bridge_channel_host.cc @@ -19,8 +19,8 @@ struct WaitableEventLazyInstanceTraits return new (instance) WaitableEvent(false, false); } }; -base::LazyInstance<WaitableEvent, WaitableEventLazyInstanceTraits> dummy_event( - base::LINKER_INITIALIZED); +base::LazyInstance<WaitableEvent, WaitableEventLazyInstanceTraits> dummy_event = + LAZY_INSTANCE_INITIALIZER; } JavaBridgeChannelHost* JavaBridgeChannelHost::GetJavaBridgeChannelHost( diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index 73b411e..c405961 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -85,7 +85,7 @@ static bool IsSuitableHost(RenderProcessHost* host, // the global list of all renderer processes base::LazyInstance<IDMap<RenderProcessHost>, base::LeakyLazyInstanceTraits<IDMap<RenderProcessHost> > > - g_all_hosts(base::LINKER_INITIALIZED); + g_all_hosts = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/browser/speech/speech_input_dispatcher_host.cc b/content/browser/speech/speech_input_dispatcher_host.cc index aacb90a3..49273a5 100644 --- a/content/browser/speech/speech_input_dispatcher_host.cc +++ b/content/browser/speech/speech_input_dispatcher_host.cc @@ -49,7 +49,7 @@ class SpeechInputDispatcherHost::SpeechInputCallers { }; static base::LazyInstance<SpeechInputDispatcherHost::SpeechInputCallers> - g_speech_input_callers(base::LINKER_INITIALIZED); + g_speech_input_callers = LAZY_INSTANCE_INITIALIZER; SpeechInputDispatcherHost::SpeechInputCallers::SpeechInputCallers() : next_id_(1) { diff --git a/content/common/net/url_fetcher_impl.cc b/content/common/net/url_fetcher_impl.cc index cbac732..87e9196 100644 --- a/content/common/net/url_fetcher_impl.cc +++ b/content/common/net/url_fetcher_impl.cc @@ -316,7 +316,7 @@ void URLFetcherImpl::Core::Registry::CancelAll() { // static base::LazyInstance<URLFetcherImpl::Core::Registry> - URLFetcherImpl::Core::g_registry(base::LINKER_INITIALIZED); + URLFetcherImpl::Core::g_registry = LAZY_INSTANCE_INITIALIZER; URLFetcherImpl::Core::TempFileWriter::TempFileWriter( URLFetcherImpl::Core* core, diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc index 62ea1e2..7b72119 100644 --- a/content/common/np_channel_base.cc +++ b/content/common/np_channel_base.cc @@ -19,12 +19,12 @@ typedef base::hash_map<std::string, scoped_refptr<NPChannelBase> > ChannelMap; static base::LazyInstance<ChannelMap, base::LeakyLazyInstanceTraits<ChannelMap> > - g_channels(base::LINKER_INITIALIZED); + g_channels = LAZY_INSTANCE_INITIALIZER; typedef std::stack<scoped_refptr<NPChannelBase> > NPChannelRefStack; static base::LazyInstance<NPChannelRefStack, base::LeakyLazyInstanceTraits<NPChannelRefStack> > - g_lazy_channel_stack(base::LINKER_INITIALIZED); + g_lazy_channel_stack = LAZY_INSTANCE_INITIALIZER; static int next_pipe_id = 0; diff --git a/content/common/socket_stream_dispatcher.cc b/content/common/socket_stream_dispatcher.cc index 6ee499e..79961b8 100644 --- a/content/common/socket_stream_dispatcher.cc +++ b/content/common/socket_stream_dispatcher.cc @@ -67,7 +67,7 @@ class IPCWebSocketStreamHandleBridge base::LazyInstance< IDMap<IPCWebSocketStreamHandleBridge>, base::LeakyLazyInstanceTraits<IDMap<IPCWebSocketStreamHandleBridge> > > - IPCWebSocketStreamHandleBridge::all_bridges(base::LINKER_INITIALIZED); + IPCWebSocketStreamHandleBridge::all_bridges = LAZY_INSTANCE_INITIALIZER; /* static */ IPCWebSocketStreamHandleBridge* IPCWebSocketStreamHandleBridge::FromSocketId( diff --git a/content/plugin/plugin_thread.cc b/content/plugin/plugin_thread.cc index 7951a8f..f4de8be 100644 --- a/content/plugin/plugin_thread.cc +++ b/content/plugin/plugin_thread.cc @@ -65,8 +65,8 @@ class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { } // namespace -static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls = + LAZY_INSTANCE_INITIALIZER; PluginThread::PluginThread() : preloaded_plugin_module_(NULL) { diff --git a/content/public/renderer/render_thread.cc b/content/public/renderer/render_thread.cc index ea04fd2..ef04a50 100644 --- a/content/public/renderer/render_thread.cc +++ b/content/public/renderer/render_thread.cc @@ -11,8 +11,8 @@ namespace content { // Keep the global RenderThread in a TLS slot so it is impossible to access // incorrectly from the wrong thread. -static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls = + LAZY_INSTANCE_INITIALIZER; RenderThread* RenderThread::Get() { return lazy_tls.Pointer()->Get(); diff --git a/content/public/renderer/render_view_observer_tracker.h b/content/public/renderer/render_view_observer_tracker.h index 5f719d1..4ea322b 100644 --- a/content/public/renderer/render_view_observer_tracker.h +++ b/content/public/renderer/render_view_observer_tracker.h @@ -61,7 +61,7 @@ class RenderViewObserverTracker { template <class T> base::LazyInstance<std::map<const RenderView*, T*> > - RenderViewObserverTracker<T>::render_view_map_(base::LINKER_INITIALIZED); + RenderViewObserverTracker<T>::render_view_map_ = LAZY_INSTANCE_INITIALIZER; } // namespace content diff --git a/content/public/utility/utility_thread.cc b/content/public/utility/utility_thread.cc index 4da5bfb..bc4bd30 100644 --- a/content/public/utility/utility_thread.cc +++ b/content/public/utility/utility_thread.cc @@ -11,8 +11,8 @@ namespace content { // Keep the global UtilityThread in a TLS slot so it is impossible to access // incorrectly from the wrong thread. -static base::LazyInstance<base::ThreadLocalPointer<UtilityThread> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<UtilityThread> > lazy_tls = + LAZY_INSTANCE_INITIALIZER; UtilityThread* UtilityThread::Get() { return lazy_tls.Pointer()->Get(); diff --git a/content/renderer/devtools_agent.cc b/content/renderer/devtools_agent.cc index cedb9d2..01041e7 100644 --- a/content/renderer/devtools_agent.cc +++ b/content/renderer/devtools_agent.cc @@ -54,7 +54,7 @@ class WebKitClientMessageLoopImpl typedef std::map<int, DevToolsAgent*> IdToAgentMap; base::LazyInstance<IdToAgentMap, base::LeakyLazyInstanceTraits<IdToAgentMap> > - g_agent_for_routing_id(base::LINKER_INITIALIZED); + g_agent_for_routing_id = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/renderer/gpu/renderer_gl_context.cc b/content/renderer/gpu/renderer_gl_context.cc index 4bf402d..03f6715 100644 --- a/content/renderer/gpu/renderer_gl_context.cc +++ b/content/renderer/gpu/renderer_gl_context.cc @@ -52,8 +52,8 @@ class GLES2Initializer { //////////////////////////////////////////////////////////////////////////////// -static base::LazyInstance<GLES2Initializer> g_gles2_initializer( - base::LINKER_INITIALIZED); +static base::LazyInstance<GLES2Initializer> g_gles2_initializer = + LAZY_INSTANCE_INITIALIZER; //////////////////////////////////////////////////////////////////////////////// diff --git a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc index 39dfc04..78584c9 100644 --- a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc @@ -37,9 +37,9 @@ static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_all_shared_contexts_lock(base::LINKER_INITIALIZED); + g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > - g_all_shared_contexts(base::LINKER_INITIALIZED); + g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl() : initialize_failed_(false), diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index ea8f8ff..a47ea0c 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -108,8 +108,8 @@ static const int kPopupListBoxMinimumRowHeight = 60; // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access // incorrectly from the wrong thread. -static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > + lazy_tls = LAZY_INSTANCE_INITIALIZER; class RenderViewZoomer : public content::RenderViewVisitor { public: diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 1c6ac4b..80ea6e2 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -251,7 +251,7 @@ using webkit_glue::ResourceFetcher; //----------------------------------------------------------------------------- typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; -static base::LazyInstance<ViewMap> g_view_map(base::LINKER_INITIALIZED); +static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; // Time, in seconds, we delay before sending content state changes (such as form // state and scroll position) to the browser. We delay sending changes to avoid diff --git a/content/worker/worker_thread.cc b/content/worker/worker_thread.cc index 3d05e49..b26cf32 100644 --- a/content/worker/worker_thread.cc +++ b/content/worker/worker_thread.cc @@ -23,8 +23,8 @@ using WebKit::WebRuntimeFeatures; -static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls = + LAZY_INSTANCE_INITIALIZER; WorkerThread::WorkerThread() { diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index 803b01c..6bebd0d 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -219,7 +219,7 @@ class NSPRInitSingleton { base::LazyInstance<NSPRInitSingleton, base::LeakyLazyInstanceTraits<NSPRInitSingleton> > - g_nspr_singleton(base::LINKER_INITIALIZED); + g_nspr_singleton = LAZY_INSTANCE_INITIALIZER; class NSSInitSingleton { public: @@ -614,7 +614,7 @@ bool NSSInitSingleton::force_nodb_init_ = false; base::LazyInstance<NSSInitSingleton, base::LeakyLazyInstanceTraits<NSSInitSingleton> > - g_nss_singleton(base::LINKER_INITIALIZED); + g_nss_singleton = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index e3b74ba..163c7ca 100644 --- a/ipc/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -206,7 +206,8 @@ class SyncChannel::ReceivedSyncMsgQueue : }; base::LazyInstance<base::ThreadLocalPointer<SyncChannel::ReceivedSyncMsgQueue> > - SyncChannel::ReceivedSyncMsgQueue::lazy_tls_ptr_(base::LINKER_INITIALIZED); + SyncChannel::ReceivedSyncMsgQueue::lazy_tls_ptr_ = + LAZY_INSTANCE_INITIALIZER; SyncChannel::SyncContext::SyncContext( Channel::Listener* listener, diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index 24ad922..d14dec6 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc @@ -25,7 +25,7 @@ struct JingleThreadWrapper::PendingSend { }; base::LazyInstance<base::ThreadLocalPointer<JingleThreadWrapper> > - g_jingle_thread_wrapper(base::LINKER_INITIALIZED); + g_jingle_thread_wrapper = LAZY_INSTANCE_INITIALIZER; // static void JingleThreadWrapper::EnsureForCurrentThread() { diff --git a/net/base/bandwidth_metrics.cc b/net/base/bandwidth_metrics.cc index fa23a77..0644122 100644 --- a/net/base/bandwidth_metrics.cc +++ b/net/base/bandwidth_metrics.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/lazy_instance.h" #include "net/base/bandwidth_metrics.h" -static base::LazyInstance<net::BandwidthMetrics> g_bandwidth_metrics( - base::LINKER_INITIALIZED); +static base::LazyInstance<net::BandwidthMetrics> g_bandwidth_metrics = + LAZY_INSTANCE_INITIALIZER; namespace net { diff --git a/net/base/cert_database_nss_unittest.cc b/net/base/cert_database_nss_unittest.cc index 7b1c3e2..1038e76 100644 --- a/net/base/cert_database_nss_unittest.cc +++ b/net/base/cert_database_nss_unittest.cc @@ -133,8 +133,8 @@ class CertDatabaseNSSTest : public testing::Test { }; // static -base::LazyInstance<ScopedTempDir> CertDatabaseNSSTest::temp_db_dir_( - base::LINKER_INITIALIZED); +base::LazyInstance<ScopedTempDir> CertDatabaseNSSTest::temp_db_dir_ = + LAZY_INSTANCE_INITIALIZER; TEST_F(CertDatabaseNSSTest, ListCerts) { // This test isn't terribly useful, though it will at least let valgrind test diff --git a/net/base/dns_reloader.cc b/net/base/dns_reloader.cc index d45c145..276d1a0 100644 --- a/net/base/dns_reloader.cc +++ b/net/base/dns_reloader.cc @@ -101,7 +101,7 @@ base::ThreadLocalStorage::Slot DnsReloader::tls_index_( base::LazyInstance<DnsReloader, base::LeakyLazyInstanceTraits<DnsReloader> > - g_dns_reloader(base::LINKER_INITIALIZED); + g_dns_reloader = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/base/ev_root_ca_metadata.cc b/net/base/ev_root_ca_metadata.cc index 6314b77..660a088 100644 --- a/net/base/ev_root_ca_metadata.cc +++ b/net/base/ev_root_ca_metadata.cc @@ -316,7 +316,7 @@ const EVRootCAMetadata::PolicyOID EVRootCAMetadata::policy_oids_[] = { static base::LazyInstance<EVRootCAMetadata, base::LeakyLazyInstanceTraits<EVRootCAMetadata> > - g_ev_root_ca_metadata(base::LINKER_INITIALIZED); + g_ev_root_ca_metadata = LAZY_INSTANCE_INITIALIZER; // static EVRootCAMetadata* EVRootCAMetadata::GetInstance() { diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 60dd125..3ba095d 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -78,7 +78,7 @@ class MimeUtil : public PlatformMimeUtil { StrictMappings strict_format_map_; }; // class MimeUtil -static base::LazyInstance<MimeUtil> g_mime_util(base::LINKER_INITIALIZED); +static base::LazyInstance<MimeUtil> g_mime_util = LAZY_INSTANCE_INITIALIZER; struct MimeInfo { const char* mime_type; diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 53206dc..204e768 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -493,7 +493,7 @@ void SetExemplarSetForLang(const std::string& lang, static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_lang_set_lock(base::LINKER_INITIALIZED); + g_lang_set_lock = LAZY_INSTANCE_INITIALIZER; // Returns true if all the characters in component_characters are used by // the language |lang|. @@ -1119,7 +1119,7 @@ const FormatUrlType kFormatUrlOmitAll = kFormatUrlOmitUsernamePassword | static base::LazyInstance<std::multiset<int>, base::LeakyLazyInstanceTraits<std::multiset<int> > > - g_explicitly_allowed_ports(base::LINKER_INITIALIZED); + g_explicitly_allowed_ports = LAZY_INSTANCE_INITIALIZER; size_t GetCountOfExplicitlyAllowedPorts() { return g_explicitly_allowed_ports.Get().size(); diff --git a/net/base/ssl_config_service.cc b/net/base/ssl_config_service.cc index 40f75c8..7f9de16 100644 --- a/net/base/ssl_config_service.cc +++ b/net/base/ssl_config_service.cc @@ -64,7 +64,7 @@ static bool g_false_start_enabled = true; static bool g_dns_cert_provenance_checking = false; base::LazyInstance<scoped_refptr<CRLSet>, base::LeakyLazyInstanceTraits<scoped_refptr<CRLSet> > > - g_crl_set(base::LINKER_INITIALIZED); + g_crl_set = LAZY_INSTANCE_INITIALIZER; // static void SSLConfigService::DisableFalseStart() { diff --git a/net/base/test_root_certs.cc b/net/base/test_root_certs.cc index 6d4bc18..6eaf0e7 100644 --- a/net/base/test_root_certs.cc +++ b/net/base/test_root_certs.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,7 +19,7 @@ bool g_has_instance = false; base::LazyInstance<TestRootCerts, base::LeakyLazyInstanceTraits<TestRootCerts> > - g_test_root_certs(base::LINKER_INITIALIZED); + g_test_root_certs = LAZY_INSTANCE_INITIALIZER; CertificateList LoadCertificates(const FilePath& filename) { std::string raw_cert; diff --git a/net/base/test_root_certs_win.cc b/net/base/test_root_certs_win.cc index 961c7d3..65be843 100644 --- a/net/base/test_root_certs_win.cc +++ b/net/base/test_root_certs_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -91,7 +91,7 @@ struct CryptoAPIInjector { base::LazyInstance<CryptoAPIInjector, base::LeakyLazyInstanceTraits<CryptoAPIInjector> > - g_capi_injector(base::LINKER_INITIALIZED); + g_capi_injector = LAZY_INSTANCE_INITIALIZER; BOOL WINAPI InterceptedOpenStoreW(LPCSTR store_provider, DWORD encoding, diff --git a/net/base/winsock_init.cc b/net/base/winsock_init.cc index 41810ef..e760185 100644 --- a/net/base/winsock_init.cc +++ b/net/base/winsock_init.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,8 +37,8 @@ class WinsockInitSingleton { } }; -static base::LazyInstance<WinsockInitSingleton> g_winsock_init_singleton( - base::LINKER_INITIALIZED); +static base::LazyInstance<WinsockInitSingleton> g_winsock_init_singleton = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc index 10e7f0a..efb19ee 100644 --- a/net/base/x509_certificate.cc +++ b/net/base/x509_certificate.cc @@ -112,7 +112,7 @@ class X509CertificateCache { base::LazyInstance<X509CertificateCache, base::LeakyLazyInstanceTraits<X509CertificateCache> > - g_x509_certificate_cache(base::LINKER_INITIALIZED); + g_x509_certificate_cache = LAZY_INSTANCE_INITIALIZER; void X509CertificateCache::InsertOrUpdate( X509Certificate::OSCertHandle* cert_handle) { diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index 1c89abb..7309021 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -720,7 +720,7 @@ class GlobalCertStore { static base::LazyInstance<GlobalCertStore, base::LeakyLazyInstanceTraits<GlobalCertStore> > - g_cert_store(base::LINKER_INITIALIZED); + g_cert_store = LAZY_INSTANCE_INITIALIZER; // static HCERTSTORE X509Certificate::cert_store() { diff --git a/net/disk_cache/file_win.cc b/net/disk_cache/file_win.cc index 0b9468c..d12f82c8 100644 --- a/net/disk_cache/file_win.cc +++ b/net/disk_cache/file_win.cc @@ -34,8 +34,8 @@ class CompletionHandler : public MessageLoopForIO::IOHandler { DWORD actual_bytes, DWORD error); }; -static base::LazyInstance<CompletionHandler> g_completion_handler( - base::LINKER_INITIALIZED); +static base::LazyInstance<CompletionHandler> g_completion_handler = + LAZY_INSTANCE_INITIALIZER; void CompletionHandler::OnIOCompleted(MessageLoopForIO::IOContext* context, DWORD actual_bytes, DWORD error) { diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index ec24107..8578972 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -86,7 +86,7 @@ class OCSPIOLoop { }; base::LazyInstance<OCSPIOLoop, base::LeakyLazyInstanceTraits<OCSPIOLoop> > - g_ocsp_io_loop(base::LINKER_INITIALIZED); + g_ocsp_io_loop = LAZY_INSTANCE_INITIALIZER; const int kRecvBufferSize = 4096; @@ -136,8 +136,8 @@ class OCSPNSSInitialization { DISALLOW_COPY_AND_ASSIGN(OCSPNSSInitialization); }; -base::LazyInstance<OCSPNSSInitialization> g_ocsp_nss_initialization( - base::LINKER_INITIALIZED); +base::LazyInstance<OCSPNSSInitialization> g_ocsp_nss_initialization = + LAZY_INSTANCE_INITIALIZER; // Concrete class for SEC_HTTP_REQUEST_SESSION. // Public methods except virtual methods of net::URLRequest::Delegate diff --git a/net/proxy/dhcpcsvc_init_win.cc b/net/proxy/dhcpcsvc_init_win.cc index 3a0aa02..7e32aea 100644 --- a/net/proxy/dhcpcsvc_init_win.cc +++ b/net/proxy/dhcpcsvc_init_win.cc @@ -26,8 +26,8 @@ class DhcpcsvcInitSingleton { } }; -static base::LazyInstance<DhcpcsvcInitSingleton> g_dhcpcsvc_init_singleton( - base::LINKER_INITIALIZED); +static base::LazyInstance<DhcpcsvcInitSingleton> g_dhcpcsvc_init_singleton = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/socket/client_socket_factory.cc b/net/socket/client_socket_factory.cc index 227a801..dd7746d 100644 --- a/net/socket/client_socket_factory.cc +++ b/net/socket/client_socket_factory.cc @@ -123,7 +123,7 @@ class DefaultClientSocketFactory : public ClientSocketFactory, }; static base::LazyInstance<DefaultClientSocketFactory> - g_default_client_socket_factory(base::LINKER_INITIALIZED); + g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/socket/dns_cert_provenance_checker.cc b/net/socket/dns_cert_provenance_checker.cc index 04cbce8..b05a382 100644 --- a/net/socket/dns_cert_provenance_checker.cc +++ b/net/socket/dns_cert_provenance_checker.cc @@ -81,8 +81,8 @@ class DnsCertLimits { DISALLOW_COPY_AND_ASSIGN(DnsCertLimits); }; -static base::LazyInstance<DnsCertLimits> g_dns_cert_limits( - base::LINKER_INITIALIZED); +static base::LazyInstance<DnsCertLimits> g_dns_cert_limits = + LAZY_INSTANCE_INITIALIZER; // DnsCertProvenanceCheck performs the DNS lookup of the certificate. This // class is self-deleting. diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc index 30cbcbf..f4dc8be 100644 --- a/net/socket/nss_ssl_util.cc +++ b/net/socket/nss_ssl_util.cc @@ -69,8 +69,8 @@ class NSSSSLInitSingleton { } }; -static base::LazyInstance<NSSSSLInitSingleton> g_nss_ssl_init_singleton( - base::LINKER_INITIALIZED); +static base::LazyInstance<NSSSSLInitSingleton> g_nss_ssl_init_singleton = + LAZY_INSTANCE_INITIALIZER; // Initialize the NSS SSL library if it isn't already initialized. This must // be called before any other NSS SSL functions. This function is diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc index 527cad5..6f87260 100644 --- a/net/socket/ssl_client_socket_mac.cc +++ b/net/socket/ssl_client_socket_mac.cc @@ -486,8 +486,8 @@ class EnabledCipherSuites { DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites); }; -static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites( - base::LINKER_INITIALIZED); +static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites = + LAZY_INSTANCE_INITIALIZER; EnabledCipherSuites::EnabledCipherSuites() { SSLContextRef ssl_context; diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc index 138265a..30441ce 100644 --- a/net/socket/ssl_client_socket_win.cc +++ b/net/socket/ssl_client_socket_win.cc @@ -196,8 +196,8 @@ class CredHandleTable { CredHandleMap client_cert_creds_; }; -static base::LazyInstance<CredHandleTable> g_cred_handle_table( - base::LINKER_INITIALIZED); +static base::LazyInstance<CredHandleTable> g_cred_handle_table = + LAZY_INSTANCE_INITIALIZER; // static int CredHandleTable::InitializeHandle(CredHandle* handle, @@ -368,8 +368,8 @@ class ClientCertStore { HCERTSTORE store_; }; -static base::LazyInstance<ClientCertStore> g_client_cert_store( - base::LINKER_INITIALIZED); +static base::LazyInstance<ClientCertStore> g_client_cert_store = + LAZY_INSTANCE_INITIALIZER; //----------------------------------------------------------------------------- diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp index 20768f0..7781bf7 100644 --- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp +++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp @@ -321,8 +321,8 @@ class PKCS12InitSingleton { } }; -static base::LazyInstance<PKCS12InitSingleton> g_pkcs12_init_singleton( - base::LINKER_INITIALIZED); +static base::LazyInstance<PKCS12InitSingleton> g_pkcs12_init_singleton = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc index fc22bdc..310fe87 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -49,7 +49,7 @@ class Driver { int clients_; }; -static base::LazyInstance<Driver> g_driver(base::LINKER_INITIALIZED); +static base::LazyInstance<Driver> g_driver = LAZY_INSTANCE_INITIALIZER; // A network client class Client { diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 66d629b..9fcae42 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -58,7 +58,7 @@ uint64 g_next_url_request_identifier = 1; // This lock protects g_next_url_request_identifier. base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_next_url_request_identifier_lock(base::LINKER_INITIALIZED); + g_next_url_request_identifier_lock = LAZY_INSTANCE_INITIALIZER; // Returns an prior unused identifier for URL requests. uint64 GenerateURLRequestIdentifier() { diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc index 1df6f63..6668b03 100644 --- a/net/url_request/url_request_test_job.cc +++ b/net/url_request/url_request_test_job.cc @@ -23,7 +23,7 @@ namespace { typedef std::list<URLRequestTestJob*> URLRequestJobList; base::LazyInstance<URLRequestJobList, base::LeakyLazyInstanceTraits<URLRequestJobList> > - g_pending_jobs(base::LINKER_INITIALIZED); + g_pending_jobs = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc index 4c64496..6a5df55 100644 --- a/net/websockets/websocket_job.cc +++ b/net/websockets/websocket_job.cc @@ -53,8 +53,8 @@ class WebSocketJobInitSingleton { } }; -static base::LazyInstance<WebSocketJobInitSingleton> g_websocket_job_init( - base::LINKER_INITIALIZED); +static base::LazyInstance<WebSocketJobInitSingleton> g_websocket_job_init = + LAZY_INSTANCE_INITIALIZER; } // anonymous namespace diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc index a164362..8d30328 100644 --- a/printing/backend/print_backend_cups.cc +++ b/printing/backend/print_backend_cups.cc @@ -79,8 +79,8 @@ class GcryptInitializer { } }; -static base::LazyInstance<GcryptInitializer> g_gcrypt_initializer( - base::LINKER_INITIALIZED); +static base::LazyInstance<GcryptInitializer> g_gcrypt_initializer = + LAZY_INSTANCE_INITIALIZER; } // namespace #endif // !defined(OS_MACOSX) diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc index ec4b51d..78c1110 100644 --- a/printing/pdf_metafile_cg_mac.cc +++ b/printing/pdf_metafile_cg_mac.cc @@ -38,7 +38,7 @@ namespace { base::LazyInstance< base::ThreadLocalPointer<struct __CFSet>, base::LeakyLazyInstanceTraits<base::ThreadLocalPointer<struct __CFSet> > > - thread_pdf_docs(base::LINKER_INITIALIZED); + thread_pdf_docs = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/printing/printed_document.cc b/printing/printed_document.cc index fc6e8e3..28a70e9 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -37,8 +37,8 @@ struct PrintDebugDumpPath { FilePath debug_dump_path; }; -static base::LazyInstance<PrintDebugDumpPath> g_debug_dump_info( - base::LINKER_INITIALIZED); +static base::LazyInstance<PrintDebugDumpPath> g_debug_dump_info = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 58e457b..a65a2a0 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -48,7 +48,7 @@ const char ChromotingInstance::kMimeType[] = "pepper-application/x-chromoting"; static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_logging_lock(base::LINKER_INITIALIZED); + g_logging_lock = LAZY_INSTANCE_INITIALIZER; ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) : pp::InstancePrivate(pp_instance), diff --git a/remoting/host/local_input_monitor_mac.mm b/remoting/host/local_input_monitor_mac.mm index 6b8f0e0..356d098 100644 --- a/remoting/host/local_input_monitor_mac.mm +++ b/remoting/host/local_input_monitor_mac.mm @@ -155,7 +155,7 @@ class LocalInputMonitorMac : public remoting::LocalInputMonitor { base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - monitor_lock(base::LINKER_INITIALIZED); + monitor_lock = LAZY_INSTANCE_INITIALIZER; LocalInputMonitorImpl* local_input_monitor = NULL; } // namespace diff --git a/remoting/host/local_input_monitor_thread_win.cc b/remoting/host/local_input_monitor_thread_win.cc index 8f9164c..490b891 100644 --- a/remoting/host/local_input_monitor_thread_win.cc +++ b/remoting/host/local_input_monitor_thread_win.cc @@ -15,7 +15,7 @@ namespace { LocalInputMonitorThread* g_local_input_monitor_thread = NULL; base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_thread_lock(base::LINKER_INITIALIZED); + g_thread_lock = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/remoting/host/plugin/host_log_handler.cc b/remoting/host/plugin/host_log_handler.cc index afd981c..557af5a 100644 --- a/remoting/host/plugin/host_log_handler.cc +++ b/remoting/host/plugin/host_log_handler.cc @@ -18,7 +18,7 @@ static bool g_has_logging_scriptable_object = false; // The lock that protects the logging globals. static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_logging_lock(base::LINKER_INITIALIZED); + g_logging_lock = LAZY_INSTANCE_INITIALIZER; // The scriptable object that will display the log information to the user. static HostNPScriptObject* g_logging_scriptable_object = NULL; diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 7cca909..9fd2c61 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc @@ -546,7 +546,7 @@ void ChromiumEnv::StartThread(void (*function)(void* arg), void* arg) { } ::base::LazyInstance<ChromiumEnv, ::base::LeakyLazyInstanceTraits<ChromiumEnv> > - default_env(::base::LINKER_INITIALIZED); + default_env = LAZY_INSTANCE_INITIALIZER; } diff --git a/ui/base/l10n/l10n_util_mac.mm b/ui/base/l10n/l10n_util_mac.mm index cab5ab9..2e40a8a 100644 --- a/ui/base/l10n/l10n_util_mac.mm +++ b/ui/base/l10n/l10n_util_mac.mm @@ -23,7 +23,7 @@ class OverrideLocaleHolder { }; base::LazyInstance<OverrideLocaleHolder> - override_locale_holder(base::LINKER_INITIALIZED); + override_locale_holder = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc index 65f5d3e..90247ea 100644 --- a/ui/base/l10n/l10n_util_win.cc +++ b/ui/base/l10n/l10n_util_win.cc @@ -67,8 +67,8 @@ class OverrideLocaleHolder { DISALLOW_COPY_AND_ASSIGN(OverrideLocaleHolder); }; -base::LazyInstance<OverrideLocaleHolder> - override_locale_holder(base::LINKER_INITIALIZED); +base::LazyInstance<OverrideLocaleHolder> override_locale_holder = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/ui/gfx/gl/gl_context.cc b/ui/gfx/gl/gl_context.cc index b4025d7..998614fb 100644 --- a/ui/gfx/gl/gl_context.cc +++ b/ui/gfx/gl/gl_context.cc @@ -20,7 +20,7 @@ namespace { base::LazyInstance< base::ThreadLocalPointer<GLContext>, base::LeakyLazyInstanceTraits<base::ThreadLocalPointer<GLContext> > > - current_context_(base::LINKER_INITIALIZED); + current_context_ = LAZY_INSTANCE_INITIALIZER; } // namespace GLContext::GLContext(GLShareGroup* share_group) : share_group_(share_group) { diff --git a/ui/gfx/gl/gl_implementation_linux.cc b/ui/gfx/gl/gl_implementation_linux.cc index eed0a15..19d3482 100644 --- a/ui/gfx/gl/gl_implementation_linux.cc +++ b/ui/gfx/gl/gl_implementation_linux.cc @@ -51,7 +51,7 @@ base::NativeLibrary LoadLibrary(const char* filename) { #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_lock(base::LINKER_INITIALIZED); + g_lock = LAZY_INSTANCE_INITIALIZER; #endif } // namespace anonymous diff --git a/ui/gfx/gl/gl_surface.cc b/ui/gfx/gl/gl_surface.cc index 78cada4..1064878 100644 --- a/ui/gfx/gl/gl_surface.cc +++ b/ui/gfx/gl/gl_surface.cc @@ -20,7 +20,7 @@ namespace { base::LazyInstance< base::ThreadLocalPointer<GLSurface>, base::LeakyLazyInstanceTraits<base::ThreadLocalPointer<GLSurface> > > - current_surface_(base::LINKER_INITIALIZED); + current_surface_ = LAZY_INSTANCE_INITIALIZER; } // namespace // static diff --git a/ui/gfx/surface/accelerated_surface_win.cc b/ui/gfx/surface/accelerated_surface_win.cc index 9efb48d..efb5706 100644 --- a/ui/gfx/surface/accelerated_surface_win.cc +++ b/ui/gfx/surface/accelerated_surface_win.cc @@ -91,7 +91,7 @@ class PresentThreadPool { }; base::LazyInstance<PresentThreadPool> - g_present_thread_pool(base::LINKER_INITIALIZED); + g_present_thread_pool = LAZY_INSTANCE_INITIALIZER; QuerySyncThread::QuerySyncThread(const char* name) : base::Thread(name), diff --git a/webkit/blob/deletable_file_reference.cc b/webkit/blob/deletable_file_reference.cc index b795b133..4a5665d 100644 --- a/webkit/blob/deletable_file_reference.cc +++ b/webkit/blob/deletable_file_reference.cc @@ -15,8 +15,8 @@ namespace webkit_blob { namespace { typedef std::map<FilePath, DeletableFileReference*> DeleteableFileMap; -static base::LazyInstance<DeleteableFileMap> g_deletable_file_map( - base::LINKER_INITIALIZED); +static base::LazyInstance<DeleteableFileMap> g_deletable_file_map = + LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index eca71dc..5e47fe4 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -411,7 +411,7 @@ const std::string& UserAgentState::Get(const GURL& url) const { return user_agent_; } -base::LazyInstance<UserAgentState> g_user_agent(base::LINKER_INITIALIZED); +base::LazyInstance<UserAgentState> g_user_agent = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index b1ff0c7..42fa3ef 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -208,10 +208,10 @@ const int32 kTransferBufferSize = 1024 * 1024; static base::LazyInstance< std::set<WebGraphicsContext3DInProcessCommandBufferImpl*> > - g_all_shared_contexts(base::LINKER_INITIALIZED); + g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_all_shared_contexts_lock(base::LINKER_INITIALIZED); + g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; // Singleton used to initialize and terminate the gles2 library. class GLES2Initializer { @@ -230,8 +230,8 @@ class GLES2Initializer { //////////////////////////////////////////////////////////////////////////////// -static base::LazyInstance<GLES2Initializer> g_gles2_initializer( - base::LINKER_INITIALIZED); +static base::LazyInstance<GLES2Initializer> g_gles2_initializer = + LAZY_INSTANCE_INITIALIZER; } // namespace anonymous @@ -297,8 +297,8 @@ GLInProcessContext* GLInProcessContext::CreateOffscreenContext( // thread. In layout tests, any thread could call this function. GLES2Decoder, // and in particular the GL implementations behind it, are not generally // threadsafe, so we guard entry points with a mutex. -static base::LazyInstance<base::Lock> - g_decoder_lock(base::LINKER_INITIALIZED); +static base::LazyInstance<base::Lock> g_decoder_lock = + LAZY_INSTANCE_INITIALIZER; void GLInProcessContext::PumpCommands() { base::AutoLock lock(g_decoder_lock.Get()); diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc index 04f635d..ef2dd7e 100644 --- a/webkit/plugins/npapi/plugin_list.cc +++ b/webkit/plugins/npapi/plugin_list.cc @@ -24,8 +24,8 @@ namespace { static const char kApplicationOctetStream[] = "application/octet-stream"; -base::LazyInstance<webkit::npapi::PluginList> g_singleton( - base::LINKER_INITIALIZED); +base::LazyInstance<webkit::npapi::PluginList> g_singleton = + LAZY_INSTANCE_INITIALIZER; bool AllowMimeTypeMismatch(const std::string& orig_mime_type, const std::string& actual_mime_type) { diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc index a4ee57a..55fcb25 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc @@ -72,30 +72,30 @@ const int kWindowedPluginPopupTimerMs = 50; WebPluginDelegateImpl* g_current_plugin_instance = NULL; typedef std::deque<MSG> ThrottleQueue; -base::LazyInstance<ThrottleQueue> g_throttle_queue(base::LINKER_INITIALIZED); -base::LazyInstance<std::map<HWND, WNDPROC> > g_window_handle_proc_map( - base::LINKER_INITIALIZED); +base::LazyInstance<ThrottleQueue> g_throttle_queue = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<std::map<HWND, WNDPROC> > g_window_handle_proc_map = + LAZY_INSTANCE_INITIALIZER; // Helper object for patching the TrackPopupMenu API. -base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_track_popup_menu( - base::LINKER_INITIALIZED); +base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_track_popup_menu = + LAZY_INSTANCE_INITIALIZER; // Helper object for patching the SetCursor API. -base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_set_cursor( - base::LINKER_INITIALIZED); +base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_set_cursor = + LAZY_INSTANCE_INITIALIZER; // Helper object for patching the RegEnumKeyExW API. -base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_reg_enum_key_ex_w( - base::LINKER_INITIALIZED); +base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_reg_enum_key_ex_w = + LAZY_INSTANCE_INITIALIZER; // Helper object for patching the GetProcAddress API. -base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_get_proc_address( - base::LINKER_INITIALIZED); +base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_get_proc_address = + LAZY_INSTANCE_INITIALIZER; // Helper object for patching the GetKeyState API. -base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_get_key_state( - base::LINKER_INITIALIZED); +base::LazyInstance<base::win::IATPatchFunction> g_iat_patch_get_key_state = + LAZY_INSTANCE_INITIALIZER; // Saved key state globals and helper access functions. SHORT (WINAPI *g_iat_orig_get_key_state)(int vkey); diff --git a/webkit/plugins/npapi/webplugin_ime_win.cc b/webkit/plugins/npapi/webplugin_ime_win.cc index e06a57f..9b92a81 100644 --- a/webkit/plugins/npapi/webplugin_ime_win.cc +++ b/webkit/plugins/npapi/webplugin_ime_win.cc @@ -27,7 +27,7 @@ namespace npapi { // WebPluginIMEWin instance through our patch function. base::LazyInstance<base::Lock, base::LeakyLazyInstanceTraits<base::Lock> > - g_webplugin_ime_lock(base::LINKER_INITIALIZED); + g_webplugin_ime_lock = LAZY_INSTANCE_INITIALIZER; WebPluginIMEWin* WebPluginIMEWin::instance_ = NULL; diff --git a/webkit/plugins/ppapi/ppapi_interface_factory.cc b/webkit/plugins/ppapi/ppapi_interface_factory.cc index 629dca9..26df97ac0 100644 --- a/webkit/plugins/ppapi/ppapi_interface_factory.cc +++ b/webkit/plugins/ppapi/ppapi_interface_factory.cc @@ -12,7 +12,7 @@ namespace webkit { namespace ppapi { base::LazyInstance<PpapiInterfaceFactoryManager> - g_ppapi_interface_factory_manager(base::LINKER_INITIALIZED); + g_ppapi_interface_factory_manager = LAZY_INSTANCE_INITIALIZER; PpapiInterfaceFactoryManager::PpapiInterfaceFactoryManager() { } diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc index 4a44a80..2b4219f 100644 --- a/webkit/tools/test_shell/simple_clipboard_impl.cc +++ b/webkit/tools/test_shell/simple_clipboard_impl.cc @@ -29,7 +29,7 @@ ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { namespace webkit_glue { -base::LazyInstance<ui::Clipboard> clipboard(base::LINKER_INITIALIZED); +base::LazyInstance<ui::Clipboard> clipboard = LAZY_INSTANCE_INITIALIZER; ui::Clipboard* ClipboardGetClipboard() { return clipboard.Pointer(); diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 35c6bfb..55748c1 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -74,7 +74,7 @@ static ui::DataPack* g_resource_data_pack = NULL; // Define static member variables base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> > - TestShell::window_map_(base::LINKER_INITIALIZED); + TestShell::window_map_ = LAZY_INSTANCE_INITIALIZER; // Helper method for getting the path to the test shell resources directory. FilePath GetResourcesFilePath() { |