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

Unified Diff: third_party/WebKit/Source/wtf/text/AtomicStringTable.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
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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.cpp ('k') | third_party/WebKit/Source/wtf/text/AtomicStringTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698