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

Unified Diff: third_party/WebKit/Source/wtf/WTFThreadData.cpp

Issue 2646003003: Avoid checking for WTFThreadData::staticData in wtfThreadData() (Closed)
Patch Set: Created 3 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: third_party/WebKit/Source/wtf/WTFThreadData.cpp
diff --git a/third_party/WebKit/Source/wtf/WTFThreadData.cpp b/third_party/WebKit/Source/wtf/WTFThreadData.cpp
index af0e33cf7796b3b1515d282b3d563d0d8729e500..a869cf7a1b583e6b3cbc4905533832878a0932a6 100644
--- a/third_party/WebKit/Source/wtf/WTFThreadData.cpp
+++ b/third_party/WebKit/Source/wtf/WTFThreadData.cpp
@@ -55,4 +55,16 @@ size_t WTFThreadData::threadStackSize() {
}
#endif
+void WTFThreadData::initializeOnMainThread() {
+ // WTFThreadData is used on main thread before it could possibly be used
+ // on secondary ones, so there is no need for synchronization here.
+ DCHECK(!WTFThreadData::staticData);
+ WTFThreadData::staticData = new ThreadSpecific<WTFThreadData>;
+ WTFThreadData::staticData->initializeOnMainThread();
+}
+
+void WTFThreadData::initializeOnOffThread() {
+ WTFThreadData::staticData->initializeOnOffThread();
+}
+
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698