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

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

Issue 2702403013: Make HashTraits<QualifiedName>::emptyValue return a const reference (Closed)
Patch Set: Global Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // This constructor is used only to create global/static QNames that don't 173 // This constructor is used only to create global/static QNames that don't
174 // require any ref counting. 174 // require any ref counting.
175 QualifiedName(const AtomicString& prefix, 175 QualifiedName(const AtomicString& prefix,
176 const AtomicString& localName, 176 const AtomicString& localName,
177 const AtomicString& namespaceURI, 177 const AtomicString& namespaceURI,
178 bool isStatic); 178 bool isStatic);
179 179
180 RefPtr<QualifiedNameImpl> m_impl; 180 RefPtr<QualifiedNameImpl> m_impl;
181 }; 181 };
182 182
183 CORE_EXPORT extern const QualifiedName& nullName;
184 inline const QualifiedName& QualifiedName::null() {
sof 2017/03/07 12:45:33 I'd prefer to define this 'inplace' with the stati
fs 2017/03/07 13:30:33 Done.
185 return nullName;
186 }
187
183 extern const QualifiedName& anyName; 188 extern const QualifiedName& anyName;
184 inline const QualifiedName& anyQName() { 189 inline const QualifiedName& anyQName() {
185 return anyName; 190 return anyName;
186 } 191 }
187 192
188 inline bool operator==(const AtomicString& a, const QualifiedName& q) { 193 inline bool operator==(const AtomicString& a, const QualifiedName& q) {
189 return a == q.localName(); 194 return a == q.localName();
190 } 195 }
191 inline bool operator!=(const AtomicString& a, const QualifiedName& q) { 196 inline bool operator!=(const AtomicString& a, const QualifiedName& q) {
192 return a != q.localName(); 197 return a != q.localName();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 234
230 template <> 235 template <>
231 struct DefaultHash<blink::QualifiedName> { 236 struct DefaultHash<blink::QualifiedName> {
232 typedef blink::QualifiedNameHash Hash; 237 typedef blink::QualifiedNameHash Hash;
233 }; 238 };
234 239
235 template <> 240 template <>
236 struct HashTraits<blink::QualifiedName> 241 struct HashTraits<blink::QualifiedName>
237 : SimpleClassHashTraits<blink::QualifiedName> { 242 : SimpleClassHashTraits<blink::QualifiedName> {
238 static const bool emptyValueIsZero = false; 243 static const bool emptyValueIsZero = false;
239 static blink::QualifiedName emptyValue() { 244 static const blink::QualifiedName& emptyValue() {
240 return blink::QualifiedName::null(); 245 return blink::QualifiedName::null();
241 } 246 }
242 }; 247 };
243 } // namespace WTF 248 } // namespace WTF
244 249
245 #endif 250 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698