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

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

Issue 2103373002: Don't lazy allocate the AtomicStringTable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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 3460e932245042fb3a3544aecf90779e4647acf2..b81e0f4697afab19c88f90ba2e96b19ba8ab556b 100644
--- a/third_party/WebKit/Source/wtf/WTFThreadData.h
+++ b/third_party/WebKit/Source/wtf/WTFThreadData.h
@@ -33,6 +33,7 @@
#include "wtf/ThreadSpecific.h"
#include "wtf/Threading.h"
#include "wtf/WTFExport.h"
+#include "wtf/text/AtomicStringTable.h"
#include "wtf/text/StringHash.h"
#include <memory>
@@ -48,11 +49,8 @@ typedef void (*CompressibleStringTableDestructor)(CompressibleStringTable*);
namespace WTF {
-class AtomicStringTable;
struct ICUConverterWrapper;
-typedef void (*AtomicStringTableDestructor)(AtomicStringTable*);
-
class WTF_EXPORT WTFThreadData {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
WTF_MAKE_NONCOPYABLE(WTFThreadData);
@@ -60,9 +58,9 @@ public:
WTFThreadData();
~WTFThreadData();
- AtomicStringTable* getAtomicStringTable()
+ AtomicStringTable& getAtomicStringTable()
{
- return m_atomicStringTable;
+ return *m_atomicStringTable;
}
blink::CompressibleStringTable* compressibleStringTable()
@@ -73,15 +71,13 @@ public:
ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; }
private:
- AtomicStringTable* m_atomicStringTable;
- AtomicStringTableDestructor m_atomicStringTableDestructor;
+ std::unique_ptr<AtomicStringTable> m_atomicStringTable;
blink::CompressibleStringTable* m_compressibleStringTable;
blink::CompressibleStringTableDestructor m_compressibleStringTableDestructor;
std::unique_ptr<ICUConverterWrapper> m_cachedConverterICU;
static ThreadSpecific<WTFThreadData>* staticData;
friend WTFThreadData& wtfThreadData();
- friend class AtomicStringTable;
friend class blink::CompressibleStringTable;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/WTFThreadData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698