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

Unified Diff: Source/core/dom/DOMArrayBufferDeallocationObserver.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/core/dom/DOMArrayBufferDeallocationObserver.cpp
diff --git a/Source/core/dom/DOMArrayBufferDeallocationObserver.cpp b/Source/core/dom/DOMArrayBufferDeallocationObserver.cpp
index 371a8dc7ea885004f7db10f365881926ac8c614d..f2d77f119c081534bfdb79147c7a6baf98ed8d19 100644
--- a/Source/core/dom/DOMArrayBufferDeallocationObserver.cpp
+++ b/Source/core/dom/DOMArrayBufferDeallocationObserver.cpp
@@ -10,11 +10,9 @@
namespace blink {
-DOMArrayBufferDeallocationObserver* DOMArrayBufferDeallocationObserver::instance()
+DOMArrayBufferDeallocationObserver& DOMArrayBufferDeallocationObserver::instance()
{
- AtomicallyInitializedStatic(
- DOMArrayBufferDeallocationObserver*,
- deallocationObserver = new DOMArrayBufferDeallocationObserver);
+ AtomicallyInitializedStaticReference(DOMArrayBufferDeallocationObserver, deallocationObserver, new DOMArrayBufferDeallocationObserver);
return deallocationObserver;
}

Powered by Google App Engine
This is Rietveld 408576698