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

Unified Diff: Source/core/dom/QualifiedName.h

Issue 15622005: Introduce LiteralSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Literal, Literal, Literal 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/editing/FormatBlockCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/QualifiedName.h
diff --git a/Source/core/dom/QualifiedName.h b/Source/core/dom/QualifiedName.h
index 38673154a67f16684d3b44f5d599e697de86d8cd..891651e87e2ad66dae392d0cea0ac3804db78910 100644
--- a/Source/core/dom/QualifiedName.h
+++ b/Source/core/dom/QualifiedName.h
@@ -21,10 +21,11 @@
#ifndef QualifiedName_h
#define QualifiedName_h
-#include <wtf/Forward.h>
-#include <wtf/HashTraits.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/AtomicString.h>
+#include "wtf/Forward.h"
+#include "wtf/HashTraits.h"
+#include "wtf/LiteralSet.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/AtomicString.h"
namespace WebCore {
@@ -128,6 +129,24 @@ inline unsigned hashComponents(const QualifiedNameComponents& buf)
return StringHasher::hashMemory<sizeof(QualifiedNameComponents)>(&buf);
}
+struct QualifiedNameComparer {
+ static bool lessThan(const QualifiedName* const& a, const QualifiedName* const& b)
+ {
+ return a->impl() < b->impl();
+ }
+};
+
+typedef LiteralSet<const QualifiedName*, QualifiedNameComparer> QualifiedNameLiteralSet;
+
+struct LocalNameComparer {
+ static bool lessThan(const QualifiedName* const& a, const QualifiedName* const& b)
+ {
+ return a->localName().impl() < b->localName().impl();
+ }
+};
+
+typedef LiteralSet<const QualifiedName*, LocalNameComparer> LocalNameLiteralSet;
+
struct QualifiedNameHash {
static unsigned hash(const QualifiedName& name) { return hash(name.impl()); }
« no previous file with comments | « no previous file | Source/core/editing/FormatBlockCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698