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

Unified Diff: Source/platform/graphics/ImageDecodingStore.cpp

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/ImageDecodingStore.cpp
diff --git a/Source/platform/graphics/ImageDecodingStore.cpp b/Source/platform/graphics/ImageDecodingStore.cpp
index 59d0fa60d8e492a45ef7886dec27ba10183a4d5f..1d7e1c942cf4a2968aa5570dcf69c6f611d2caa7 100644
--- a/Source/platform/graphics/ImageDecodingStore.cpp
+++ b/Source/platform/graphics/ImageDecodingStore.cpp
@@ -53,9 +53,9 @@ ImageDecodingStore::~ImageDecodingStore()
#endif
}
-ImageDecodingStore* ImageDecodingStore::instance()
+ImageDecodingStore& ImageDecodingStore::instance()
{
- AtomicallyInitializedStatic(ImageDecodingStore*, store = ImageDecodingStore::create().leakPtr());
+ AtomicallyInitializedStaticReference(ImageDecodingStore, store, ImageDecodingStore::create().leakPtr());
return store;
}

Powered by Google App Engine
This is Rietveld 408576698