Index: third_party/WebKit/Source/wtf/text/AtomicStringTable.h |
diff --git a/third_party/WebKit/Source/wtf/text/AtomicStringTable.h b/third_party/WebKit/Source/wtf/text/AtomicStringTable.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e129b59d517474cd2f7093414c635704c30aee47 |
--- /dev/null |
+++ b/third_party/WebKit/Source/wtf/text/AtomicStringTable.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WTF_AtomicStringTable_h |
+#define WTF_AtomicStringTable_h |
+ |
+#include "wtf/Allocator.h" |
+#include "wtf/HashSet.h" |
+#include "wtf/text/StringHash.h" |
+#include "wtf/text/StringImpl.h" |
+ |
+namespace WTF { |
+ |
+// The underlying storage that keeps the map of unique AtomicStrings. This is |
+// not thread safe and each WTFThreadData has one. |
+class AtomicStringTable { |
+ USING_FAST_MALLOC(AtomicStringTable); |
+ WTF_MAKE_NONCOPYABLE(AtomicStringTable); |
+public: |
+ AtomicStringTable(); |
+ ~AtomicStringTable(); |
+ |
+ StringImpl* addStringImpl(StringImpl*); |
+ |
+ HashSet<StringImpl*>& table() { return m_table; } |
+ |
+private: |
+ HashSet<StringImpl*> m_table; |
+}; |
+ |
+} // namespace WTF |
+ |
+#endif |