OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WTF_AtomicStringTable_h |
| 6 #define WTF_AtomicStringTable_h |
| 7 |
| 8 #include "wtf/Allocator.h" |
| 9 #include "wtf/HashSet.h" |
| 10 #include "wtf/text/StringHash.h" |
| 11 #include "wtf/text/StringImpl.h" |
| 12 |
| 13 namespace WTF { |
| 14 |
| 15 // The underlying storage that keeps the map of unique AtomicStrings. This is |
| 16 // not thread safe and each WTFThreadData has one. |
| 17 class AtomicStringTable { |
| 18 USING_FAST_MALLOC(AtomicStringTable); |
| 19 WTF_MAKE_NONCOPYABLE(AtomicStringTable); |
| 20 public: |
| 21 AtomicStringTable(); |
| 22 ~AtomicStringTable(); |
| 23 |
| 24 StringImpl* addStringImpl(StringImpl*); |
| 25 |
| 26 HashSet<StringImpl*>& table() { return m_table; } |
| 27 |
| 28 private: |
| 29 HashSet<StringImpl*> m_table; |
| 30 }; |
| 31 |
| 32 } // namespace WTF |
| 33 |
| 34 #endif |
OLD | NEW |