OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #define AtomicString_h | 22 #define AtomicString_h |
23 | 23 |
24 #include "wtf/HashTableDeletedValueType.h" | 24 #include "wtf/HashTableDeletedValueType.h" |
25 #include "wtf/WTFExport.h" | 25 #include "wtf/WTFExport.h" |
26 #include "wtf/text/CString.h" | 26 #include "wtf/text/CString.h" |
27 #include "wtf/text/WTFString.h" | 27 #include "wtf/text/WTFString.h" |
28 | 28 |
29 namespace WTF { | 29 namespace WTF { |
30 | 30 |
31 struct AtomicStringHash; | 31 struct AtomicStringHash; |
32 class AtomicStringTable; | |
32 | 33 |
33 class WTF_EXPORT AtomicString { | 34 class WTF_EXPORT AtomicString { |
34 public: | 35 public: |
35 static void init(); | 36 static void init(); |
36 | 37 |
37 AtomicString() { } | 38 AtomicString() { } |
38 AtomicString(const LChar* s) : m_string(add(s)) { } | 39 AtomicString(const LChar* s) : m_string(add(s)) { } |
39 AtomicString(const char* s) : m_string(add(s)) { } | 40 AtomicString(const char* s) : m_string(add(s)) { } |
40 AtomicString(const LChar* s, unsigned length) : m_string(add(s, length)) { } | 41 AtomicString(const LChar* s, unsigned length) : m_string(add(s, length)) { } |
41 AtomicString(const UChar* s, unsigned length) : m_string(add(s, length)) { } | 42 AtomicString(const UChar* s, unsigned length) : m_string(add(s, length)) { } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 return r; | 174 return r; |
174 return addSlowCase(r); | 175 return addSlowCase(r); |
175 } | 176 } |
176 static PassRefPtr<StringImpl> addFromLiteralData(const char* characters, uns igned length); | 177 static PassRefPtr<StringImpl> addFromLiteralData(const char* characters, uns igned length); |
177 static PassRefPtr<StringImpl> addSlowCase(StringImpl*); | 178 static PassRefPtr<StringImpl> addSlowCase(StringImpl*); |
178 #if USE(CF) | 179 #if USE(CF) |
179 static PassRefPtr<StringImpl> add(CFStringRef); | 180 static PassRefPtr<StringImpl> add(CFStringRef); |
180 #endif | 181 #endif |
181 | 182 |
182 static AtomicString fromUTF8Internal(const char*, const char*); | 183 static AtomicString fromUTF8Internal(const char*, const char*); |
184 | |
185 static AtomicStringTable* createAtomicStringTable(); | |
tkent
2015/10/04 22:47:47
I wonder why createAtomicStringTable and destroyAt
| |
186 static void destroyAtomicStringTable(AtomicStringTable*); | |
187 friend class WTFThreadData; | |
183 }; | 188 }; |
184 | 189 |
185 inline bool operator==(const AtomicString& a, const AtomicString& b) { return a. impl() == b.impl(); } | 190 inline bool operator==(const AtomicString& a, const AtomicString& b) { return a. impl() == b.impl(); } |
186 WTF_EXPORT bool operator==(const AtomicString&, const LChar*); | 191 WTF_EXPORT bool operator==(const AtomicString&, const LChar*); |
187 inline bool operator==(const AtomicString& a, const char* b) { return WTF::equal (a.impl(), reinterpret_cast<const LChar*>(b)); } | 192 inline bool operator==(const AtomicString& a, const char* b) { return WTF::equal (a.impl(), reinterpret_cast<const LChar*>(b)); } |
188 inline bool operator==(const AtomicString& a, const Vector<UChar>& b) { return a .impl() && equal(a.impl(), b.data(), b.size()); } | 193 inline bool operator==(const AtomicString& a, const Vector<UChar>& b) { return a .impl() && equal(a.impl(), b.data(), b.size()); } |
189 inline bool operator==(const AtomicString& a, const String& b) { return equal(a. impl(), b.impl()); } | 194 inline bool operator==(const AtomicString& a, const String& b) { return equal(a. impl(), b.impl()); } |
190 inline bool operator==(const LChar* a, const AtomicString& b) { return b == a; } | 195 inline bool operator==(const LChar* a, const AtomicString& b) { return b == a; } |
191 inline bool operator==(const char* a, const AtomicString& b) { return b == a; } | 196 inline bool operator==(const char* a, const AtomicString& b) { return b == a; } |
192 inline bool operator==(const String& a, const AtomicString& b) { return equal(a. impl(), b.impl()); } | 197 inline bool operator==(const String& a, const AtomicString& b) { return equal(a. impl(), b.impl()); } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 using WTF::AtomicString; | 255 using WTF::AtomicString; |
251 using WTF::nullAtom; | 256 using WTF::nullAtom; |
252 using WTF::emptyAtom; | 257 using WTF::emptyAtom; |
253 using WTF::starAtom; | 258 using WTF::starAtom; |
254 using WTF::xmlAtom; | 259 using WTF::xmlAtom; |
255 using WTF::xmlnsAtom; | 260 using WTF::xmlnsAtom; |
256 using WTF::xlinkAtom; | 261 using WTF::xlinkAtom; |
257 | 262 |
258 #include "wtf/text/StringConcatenate.h" | 263 #include "wtf/text/StringConcatenate.h" |
259 #endif // AtomicString_h | 264 #endif // AtomicString_h |
OLD | NEW |