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

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

Issue 459203004: Have DocumentOrderedMap API deal with AtomicString type instead of StringImpl* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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 | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentOrderedMap.h
diff --git a/Source/core/dom/DocumentOrderedMap.h b/Source/core/dom/DocumentOrderedMap.h
index a0aa1b2533815e0cbd8706f86cc337207bfef07a..b843a2430641f2e89dba820545537120b3a86805 100644
--- a/Source/core/dom/DocumentOrderedMap.h
+++ b/Source/core/dom/DocumentOrderedMap.h
@@ -34,6 +34,7 @@
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
+#include "wtf/text/AtomicString.h"
#include "wtf/text/StringImpl.h"
namespace blink {
@@ -44,22 +45,23 @@ class TreeScope;
class DocumentOrderedMap : public NoBaseWillBeGarbageCollected<DocumentOrderedMap> {
public:
static PassOwnPtrWillBeRawPtr<DocumentOrderedMap> create();
- void add(StringImpl*, Element*);
- void remove(StringImpl*, Element*);
+ void add(const AtomicString&, Element*);
+ void remove(const AtomicString&, Element*);
- bool contains(StringImpl*) const;
- bool containsMultiple(StringImpl*) const;
+ bool contains(const AtomicString&) const;
+ bool containsMultiple(const AtomicString&) const;
// concrete instantiations of the get<>() method template
- Element* getElementById(StringImpl*, const TreeScope*) const;
- const WillBeHeapVector<RawPtrWillBeMember<Element> >& getAllElementsById(StringImpl*, const TreeScope*) const;
- Element* getElementByMapName(StringImpl*, const TreeScope*) const;
- Element* getElementByLowercasedMapName(StringImpl*, const TreeScope*) const;
- Element* getElementByLabelForAttribute(StringImpl*, const TreeScope*) const;
+ Element* getElementById(const AtomicString&, const TreeScope*) const;
+ const WillBeHeapVector<RawPtrWillBeMember<Element> >& getAllElementsById(const AtomicString&, const TreeScope*) const;
+ Element* getElementByMapName(const AtomicString&, const TreeScope*) const;
+ Element* getElementByLowercasedMapName(const AtomicString&, const TreeScope*) const;
+ Element* getElementByLabelForAttribute(const AtomicString&, const TreeScope*) const;
void trace(Visitor*);
private:
- template<bool keyMatches(StringImpl*, Element&)> Element* get(StringImpl*, const TreeScope*) const;
+ template<bool keyMatches(const AtomicString&, const Element&)>
+ Element* get(const AtomicString&, const TreeScope*) const;
class MapEntry : public NoBaseWillBeGarbageCollected<MapEntry> {
public:
@@ -81,14 +83,14 @@ private:
mutable Map m_map;
};
-inline bool DocumentOrderedMap::contains(StringImpl* id) const
+inline bool DocumentOrderedMap::contains(const AtomicString& id) const
{
- return m_map.contains(id);
+ return m_map.contains(id.impl());
}
-inline bool DocumentOrderedMap::containsMultiple(StringImpl* id) const
+inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const
{
- Map::const_iterator it = m_map.find(id);
+ Map::const_iterator it = m_map.find(id.impl());
return it != m_map.end() && it->value->count > 1;
}
« no previous file with comments | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698