| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef DocumentOrderedMap_h | 31 #ifndef DocumentOrderedMap_h |
| 32 #define DocumentOrderedMap_h | 32 #define DocumentOrderedMap_h |
| 33 | 33 |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "wtf/Allocator.h" |
| 35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 36 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
| 37 #include "wtf/text/AtomicString.h" | 38 #include "wtf/text/AtomicString.h" |
| 38 #include "wtf/text/AtomicStringHash.h" | 39 #include "wtf/text/AtomicStringHash.h" |
| 39 #include "wtf/text/StringImpl.h" | 40 #include "wtf/text/StringImpl.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class Element; | 44 class Element; |
| 44 class TreeScope; | 45 class TreeScope; |
| 45 | 46 |
| 46 class DocumentOrderedMap : public NoBaseWillBeGarbageCollected<DocumentOrderedMa
p> { | 47 class DocumentOrderedMap : public NoBaseWillBeGarbageCollected<DocumentOrderedMa
p> { |
| 48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DocumentOrderedMap); |
| 47 public: | 49 public: |
| 48 static PassOwnPtrWillBeRawPtr<DocumentOrderedMap> create(); | 50 static PassOwnPtrWillBeRawPtr<DocumentOrderedMap> create(); |
| 49 void add(const AtomicString&, Element*); | 51 void add(const AtomicString&, Element*); |
| 50 void remove(const AtomicString&, Element*); | 52 void remove(const AtomicString&, Element*); |
| 51 | 53 |
| 52 bool contains(const AtomicString&) const; | 54 bool contains(const AtomicString&) const; |
| 53 bool containsMultiple(const AtomicString&) const; | 55 bool containsMultiple(const AtomicString&) const; |
| 54 // concrete instantiations of the get<>() method template | 56 // concrete instantiations of the get<>() method template |
| 55 Element* getElementById(const AtomicString&, const TreeScope*) const; | 57 Element* getElementById(const AtomicString&, const TreeScope*) const; |
| 56 const WillBeHeapVector<RawPtrWillBeMember<Element>>& getAllElementsById(cons
t AtomicString&, const TreeScope*) const; | 58 const WillBeHeapVector<RawPtrWillBeMember<Element>>& getAllElementsById(cons
t AtomicString&, const TreeScope*) const; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 93 |
| 92 inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const | 94 inline bool DocumentOrderedMap::containsMultiple(const AtomicString& id) const |
| 93 { | 95 { |
| 94 Map::const_iterator it = m_map.find(id); | 96 Map::const_iterator it = m_map.find(id); |
| 95 return it != m_map.end() && it->value->count > 1; | 97 return it != m_map.end() && it->value->count > 1; |
| 96 } | 98 } |
| 97 | 99 |
| 98 } // namespace blink | 100 } // namespace blink |
| 99 | 101 |
| 100 #endif // DocumentOrderedMap_h | 102 #endif // DocumentOrderedMap_h |
| OLD | NEW |