OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2009 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 return a == q.localName(); | 195 return a == q.localName(); |
196 } | 196 } |
197 inline bool operator!=(const QualifiedName& q, const AtomicString& a) { | 197 inline bool operator!=(const QualifiedName& q, const AtomicString& a) { |
198 return a != q.localName(); | 198 return a != q.localName(); |
199 } | 199 } |
200 | 200 |
201 inline unsigned hashComponents(const QualifiedNameComponents& buf) { | 201 inline unsigned hashComponents(const QualifiedNameComponents& buf) { |
202 return StringHasher::hashMemory<sizeof(QualifiedNameComponents)>(&buf); | 202 return StringHasher::hashMemory<sizeof(QualifiedNameComponents)>(&buf); |
203 } | 203 } |
204 | 204 |
205 struct QualifiedNameHash { | 205 struct CORE_EXPORT QualifiedNameHash { |
206 STATIC_ONLY(QualifiedNameHash); | 206 STATIC_ONLY(QualifiedNameHash); |
207 static unsigned hash(const QualifiedName& name) { return hash(name.impl()); } | 207 static unsigned hash(const QualifiedName& name) { return hash(name.impl()); } |
208 | 208 |
209 static unsigned hash(const QualifiedName::QualifiedNameImpl* name) { | 209 static unsigned hash(const QualifiedName::QualifiedNameImpl* name) { |
210 if (!name->m_existingHash) | 210 if (!name->m_existingHash) |
211 name->m_existingHash = name->computeHash(); | 211 name->m_existingHash = name->computeHash(); |
212 return name->m_existingHash; | 212 return name->m_existingHash; |
213 } | 213 } |
214 | 214 |
215 static bool equal(const QualifiedName& a, const QualifiedName& b) { | 215 static bool equal(const QualifiedName& a, const QualifiedName& b) { |
(...skipping 20 matching lines...) Expand all Loading... |
236 struct HashTraits<blink::QualifiedName> | 236 struct HashTraits<blink::QualifiedName> |
237 : SimpleClassHashTraits<blink::QualifiedName> { | 237 : SimpleClassHashTraits<blink::QualifiedName> { |
238 static const bool emptyValueIsZero = false; | 238 static const bool emptyValueIsZero = false; |
239 static blink::QualifiedName emptyValue() { | 239 static blink::QualifiedName emptyValue() { |
240 return blink::QualifiedName::null(); | 240 return blink::QualifiedName::null(); |
241 } | 241 } |
242 }; | 242 }; |
243 } // namespace WTF | 243 } // namespace WTF |
244 | 244 |
245 #endif | 245 #endif |
OLD | NEW |