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

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

Issue 192293002: Use new is*Element() helper functions in DOM code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add is*Element(PassRefPtr) helper Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 bool contains(StringImpl*) const; 48 bool contains(StringImpl*) const;
49 bool containsMultiple(StringImpl*) const; 49 bool containsMultiple(StringImpl*) const;
50 // concrete instantiations of the get<>() method template 50 // concrete instantiations of the get<>() method template
51 Element* getElementById(StringImpl*, const TreeScope*) const; 51 Element* getElementById(StringImpl*, const TreeScope*) const;
52 const Vector<Element*>& getAllElementsById(StringImpl*, const TreeScope*) co nst; 52 const Vector<Element*>& getAllElementsById(StringImpl*, const TreeScope*) co nst;
53 Element* getElementByMapName(StringImpl*, const TreeScope*) const; 53 Element* getElementByMapName(StringImpl*, const TreeScope*) const;
54 Element* getElementByLowercasedMapName(StringImpl*, const TreeScope*) const; 54 Element* getElementByLowercasedMapName(StringImpl*, const TreeScope*) const;
55 Element* getElementByLabelForAttribute(StringImpl*, const TreeScope*) const; 55 Element* getElementByLabelForAttribute(StringImpl*, const TreeScope*) const;
56 56
57 private: 57 private:
58 template<bool keyMatches(StringImpl*, Element*)> Element* get(StringImpl*, c onst TreeScope*) const; 58 template<bool keyMatches(StringImpl*, Element&)> Element* get(StringImpl*, c onst TreeScope*) const;
59 59
60 struct MapEntry { 60 struct MapEntry {
61 explicit MapEntry(Element* firstElement) 61 explicit MapEntry(Element* firstElement)
62 : element(firstElement) 62 : element(firstElement)
63 , count(1) 63 , count(1)
64 { } 64 { }
65 65
66 Element* element; 66 Element* element;
67 unsigned count; 67 unsigned count;
68 Vector<Element*> orderedList; 68 Vector<Element*> orderedList;
(...skipping 11 matching lines...) Expand all
80 80
81 inline bool DocumentOrderedMap::containsMultiple(StringImpl* id) const 81 inline bool DocumentOrderedMap::containsMultiple(StringImpl* id) const
82 { 82 {
83 Map::const_iterator it = m_map.find(id); 83 Map::const_iterator it = m_map.find(id);
84 return it != m_map.end() && it->value->count > 1; 84 return it != m_map.end() && it->value->count > 1;
85 } 85 }
86 86
87 } // namespace WebCore 87 } // namespace WebCore
88 88
89 #endif // DocumentOrderedMap_h 89 #endif // DocumentOrderedMap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698