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

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

Issue 1370113006: AtomicStringTable should not be initialized lazily Base URL: https://chromium.googlesource.com/chromium/src.git@AtomitStringTable
Patch Set: Export AtomicStringTable Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadingWin.cpp ('k') | third_party/WebKit/Source/wtf/WTFThreadData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/WTFThreadData.h
diff --git a/third_party/WebKit/Source/wtf/WTFThreadData.h b/third_party/WebKit/Source/wtf/WTFThreadData.h
index 0dbd7e7c6baad8383340a53c35bf04bf1b21fec1..4e541352a886844a4aa625106cf709096e98402c 100644
--- a/third_party/WebKit/Source/wtf/WTFThreadData.h
+++ b/third_party/WebKit/Source/wtf/WTFThreadData.h
@@ -40,14 +40,14 @@ namespace WTF {
class AtomicStringTable;
struct ICUConverterWrapper;
-typedef void (*AtomicStringTableDestructor)(AtomicStringTable*);
-
class WTF_EXPORT WTFThreadData {
WTF_MAKE_NONCOPYABLE(WTFThreadData);
public:
WTFThreadData();
~WTFThreadData();
+ static void createData();
+
AtomicStringTable* atomicStringTable()
{
return m_atomicStringTable;
@@ -57,25 +57,16 @@ public:
private:
AtomicStringTable* m_atomicStringTable;
- AtomicStringTableDestructor m_atomicStringTableDestructor;
OwnPtr<ICUConverterWrapper> m_cachedConverterICU;
- static ThreadSpecific<WTFThreadData>* staticData;
+ static ThreadSpecific<WTFThreadData>* s_staticData;
friend WTFThreadData& wtfThreadData();
- friend class AtomicStringTable;
};
inline WTFThreadData& wtfThreadData()
{
- // WRT WebCore:
- // WTFThreadData is used on main thread before it could possibly be used
- // on secondary ones, so there is no need for synchronization here.
- // WRT JavaScriptCore:
- // wtfThreadData() is initially called from initializeThreading(), ensuring
- // this is initially called in a pthread_once locked context.
- if (!WTFThreadData::staticData)
- WTFThreadData::staticData = new ThreadSpecific<WTFThreadData>;
- return **WTFThreadData::staticData;
+ ASSERT(WTFThreadData::s_staticData);
+ return **WTFThreadData::s_staticData;
}
} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadingWin.cpp ('k') | third_party/WebKit/Source/wtf/WTFThreadData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698