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

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

Issue 1455943002: [Oilpan] Prepare full definition of classes before using Member (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CORE_EXPORT Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 Element* getElementByLabelForAttribute(const AtomicString&, const TreeScope* ) const; 61 Element* getElementByLabelForAttribute(const AtomicString&, const TreeScope* ) const;
62 62
63 DECLARE_TRACE(); 63 DECLARE_TRACE();
64 64
65 private: 65 private:
66 template<bool keyMatches(const AtomicString&, const Element&)> 66 template<bool keyMatches(const AtomicString&, const Element&)>
67 Element* get(const AtomicString&, const TreeScope*) const; 67 Element* get(const AtomicString&, const TreeScope*) const;
68 68
69 class MapEntry : public NoBaseWillBeGarbageCollected<MapEntry> { 69 class MapEntry : public NoBaseWillBeGarbageCollected<MapEntry> {
70 public: 70 public:
71 explicit MapEntry(Element* firstElement) 71 explicit MapEntry(Element*);
72 : element(firstElement)
73 , count(1)
74 {
75 }
76 72
77 DECLARE_TRACE(); 73 DECLARE_TRACE();
78 74
79 RawPtrWillBeMember<Element> element; 75 RawPtrWillBeMember<Element> element;
80 unsigned count; 76 unsigned count;
81 WillBeHeapVector<RawPtrWillBeMember<Element>> orderedList; 77 WillBeHeapVector<RawPtrWillBeMember<Element>> orderedList;
82 }; 78 };
83 79
84 using Map = WillBeHeapHashMap<AtomicString, OwnPtrWillBeMember<MapEntry>>; 80 using Map = WillBeHeapHashMap<AtomicString, OwnPtrWillBeMember<MapEntry>>;
85 81
86 mutable Map m_map; 82 mutable Map m_map;
87 }; 83 };
88 84
89 inline bool DocumentOrderedMap::contains(const AtomicString& id) const 85 inline bool DocumentOrderedMap::contains(const AtomicString& id) const
90 { 86 {
91 return m_map.contains(id); 87 return m_map.contains(id);
92 } 88 }
93 89
94 inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const 90 inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const
95 { 91 {
96 Map::const_iterator it = m_map.find(id); 92 Map::const_iterator it = m_map.find(id);
97 return it != m_map.end() && it->value->count > 1; 93 return it != m_map.end() && it->value->count > 1;
98 } 94 }
99 95
100 } // namespace blink 96 } // namespace blink
101 97
102 #endif // DocumentOrderedMap_h 98 #endif // DocumentOrderedMap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698