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

Unified Diff: base/lazy_instance_unittest.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/lazy_instance.cc ('k') | base/mac/scoped_nsexception_enabler.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/lazy_instance_unittest.cc
diff --git a/base/lazy_instance_unittest.cc b/base/lazy_instance_unittest.cc
index 28bf04ebb4238ba45e294f90e9559beb5e38f6ab..b63e9222910576872cac9634d0a0f58de54889b4 100644
--- a/base/lazy_instance_unittest.cc
+++ b/base/lazy_instance_unittest.cc
@@ -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);
« no previous file with comments | « base/lazy_instance.cc ('k') | base/mac/scoped_nsexception_enabler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698