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

Unified Diff: third_party/WebKit/Source/wtf/text/AtomicString.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
Index: third_party/WebKit/Source/wtf/text/AtomicString.h
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h
index e90a664e370ea9bf005d58da335beef49eae28dc..0e500e18af3b4d3337fd4218bbd4c881a20393d8 100644
--- a/third_party/WebKit/Source/wtf/text/AtomicString.h
+++ b/third_party/WebKit/Source/wtf/text/AtomicString.h
@@ -21,6 +21,7 @@
#ifndef AtomicString_h
#define AtomicString_h
+#include "wtf/HashSet.h"
#include "wtf/HashTableDeletedValueType.h"
#include "wtf/WTFExport.h"
#include "wtf/text/CString.h"
@@ -29,6 +30,7 @@
namespace WTF {
struct AtomicStringHash;
+class AtomicStringTable;
class WTF_EXPORT AtomicString {
public:
@@ -182,6 +184,22 @@ private:
static AtomicString fromUTF8Internal(const char*, const char*);
};
+class AtomicStringTable {
+ WTF_MAKE_NONCOPYABLE(AtomicStringTable);
+public:
+ StringImpl* addStringImpl(StringImpl*);
+
+ HashSet<StringImpl*>& table() { return m_table; }
+
+private:
+ AtomicStringTable() = default;
+ static AtomicStringTable* create();
+ static void destroy(AtomicStringTable*);
+ friend class WTFThreadData;
+
+ HashSet<StringImpl*> m_table;
+};
+
inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }
WTF_EXPORT bool operator==(const AtomicString&, const LChar*);
inline bool operator==(const AtomicString& a, const char* b) { return WTF::equal(a.impl(), reinterpret_cast<const LChar*>(b)); }
« no previous file with comments | « third_party/WebKit/Source/wtf/WTFThreadData.cpp ('k') | third_party/WebKit/Source/wtf/text/AtomicString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698