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

Unified Diff: sky/engine/core/dom/DocumentOrderedMap.h

Issue 705473004: Remove most of DocumentOrderedMap. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | sky/engine/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/DocumentOrderedMap.h
diff --git a/sky/engine/core/dom/DocumentOrderedMap.h b/sky/engine/core/dom/DocumentOrderedMap.h
index 81a7fdf2cfa5ca877997ca116b9f5f82f03e3bd3..eb06303afdc2b52a210258740932bdc42a757c55 100644
--- a/sky/engine/core/dom/DocumentOrderedMap.h
+++ b/sky/engine/core/dom/DocumentOrderedMap.h
@@ -31,70 +31,42 @@
#ifndef DocumentOrderedMap_h
#define DocumentOrderedMap_h
-#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/AtomicStringHash.h"
-#include "wtf/text/StringImpl.h"
namespace blink {
class Element;
class TreeScope;
-class DocumentOrderedMap : public DummyBase<DocumentOrderedMap> {
+class DocumentOrderedMap {
public:
static PassOwnPtr<DocumentOrderedMap> create();
+
void add(const AtomicString&, Element*);
void remove(const AtomicString&, Element*);
- bool contains(const AtomicString&) const;
- bool containsMultiple(const AtomicString&) const;
- // concrete instantiations of the get<>() method template
Element* getElementById(const AtomicString&, const TreeScope*) const;
- const Vector<RawPtr<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(const AtomicString&, const Element&)>
- Element* get(const AtomicString&, const TreeScope*) const;
-
- class MapEntry : public DummyBase<MapEntry> {
+ class MapEntry {
public:
- explicit MapEntry(Element* firstElement)
- : element(firstElement)
+ explicit MapEntry(Element* element)
+ : element(element)
, count(1)
{
}
- void trace(Visitor*);
-
- RawPtr<Element> element;
+ Element* element;
unsigned count;
- Vector<RawPtr<Element> > orderedList;
};
typedef HashMap<AtomicString, OwnPtr<MapEntry> > Map;
-
- mutable Map m_map;
+ Map m_map;
};
-inline bool DocumentOrderedMap::contains(const AtomicString& id) const
-{
- return m_map.contains(id);
-}
-
-inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const
-{
- Map::const_iterator it = m_map.find(id);
- return it != m_map.end() && it->value->count > 1;
-}
-
} // namespace blink
#endif // DocumentOrderedMap_h
« no previous file with comments | « no previous file | sky/engine/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698