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

Side by Side Diff: Source/core/dom/QualifiedName.h

Issue 15622005: Introduce LiteralSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaned Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 inline const QualifiedName& anyQName() { return anyName; } 116 inline const QualifiedName& anyQName() { return anyName; }
117 #endif 117 #endif
118 118
119 const QualifiedName& nullQName(); 119 const QualifiedName& nullQName();
120 120
121 inline bool operator==(const AtomicString& a, const QualifiedName& q) { return a == q.localName(); } 121 inline bool operator==(const AtomicString& a, const QualifiedName& q) { return a == q.localName(); }
122 inline bool operator!=(const AtomicString& a, const QualifiedName& q) { return a != q.localName(); } 122 inline bool operator!=(const AtomicString& a, const QualifiedName& q) { return a != q.localName(); }
123 inline bool operator==(const QualifiedName& q, const AtomicString& a) { return a == q.localName(); } 123 inline bool operator==(const QualifiedName& q, const AtomicString& a) { return a == q.localName(); }
124 inline bool operator!=(const QualifiedName& q, const AtomicString& a) { return a != q.localName(); } 124 inline bool operator!=(const QualifiedName& q, const AtomicString& a) { return a != q.localName(); }
125 125
126 // Useful with TableSet.
127 bool lessThanByImplAddress(const QualifiedName* const&, const QualifiedName* con st&);
eseidel 2013/05/22 00:40:14 I think these probably belong as static class meth
128 bool lessThanByLocalNameImplAddress(const QualifiedName* const&, const Qualified Name* const&);
129
126 inline unsigned hashComponents(const QualifiedNameComponents& buf) 130 inline unsigned hashComponents(const QualifiedNameComponents& buf)
127 { 131 {
128 return StringHasher::hashMemory<sizeof(QualifiedNameComponents)>(&buf); 132 return StringHasher::hashMemory<sizeof(QualifiedNameComponents)>(&buf);
129 } 133 }
130 134
131 struct QualifiedNameHash { 135 struct QualifiedNameHash {
132 static unsigned hash(const QualifiedName& name) { return hash(name.impl()); } 136 static unsigned hash(const QualifiedName& name) { return hash(name.impl()); }
133 137
134 static unsigned hash(const QualifiedName::QualifiedNameImpl* name) 138 static unsigned hash(const QualifiedName::QualifiedNameImpl* name)
135 { 139 {
(...skipping 21 matching lines...) Expand all
157 typedef WebCore::QualifiedNameHash Hash; 161 typedef WebCore::QualifiedNameHash Hash;
158 }; 162 };
159 163
160 template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits <WebCore::QualifiedName> { 164 template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits <WebCore::QualifiedName> {
161 static const bool emptyValueIsZero = false; 165 static const bool emptyValueIsZero = false;
162 static WebCore::QualifiedName emptyValue() { return WebCore::nullQName() ; } 166 static WebCore::QualifiedName emptyValue() { return WebCore::nullQName() ; }
163 }; 167 };
164 } 168 }
165 169
166 #endif 170 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/QualifiedName.cpp » ('j') | Source/core/editing/ReplaceSelectionCommand.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698