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

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

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 inline bool keyMatchesSlotName(const AtomicString& key, 73 inline bool keyMatchesSlotName(const AtomicString& key,
74 const Element& element) { 74 const Element& element) {
75 return isHTMLSlotElement(element) && toHTMLSlotElement(element).name() == key; 75 return isHTMLSlotElement(element) && toHTMLSlotElement(element).name() == key;
76 } 76 }
77 77
78 void DocumentOrderedMap::add(const AtomicString& key, Element* element) { 78 void DocumentOrderedMap::add(const AtomicString& key, Element* element) {
79 DCHECK(key); 79 DCHECK(key);
80 DCHECK(element); 80 DCHECK(element);
81 81
82 Map::AddResult addResult = m_map.add(key, new MapEntry(element)); 82 Map::AddResult addResult = m_map.insert(key, new MapEntry(element));
83 if (addResult.isNewEntry) 83 if (addResult.isNewEntry)
84 return; 84 return;
85 85
86 Member<MapEntry>& entry = addResult.storedValue->value; 86 Member<MapEntry>& entry = addResult.storedValue->value;
87 DCHECK(entry->count); 87 DCHECK(entry->count);
88 entry->element = nullptr; 88 entry->element = nullptr;
89 entry->count++; 89 entry->count++;
90 entry->orderedList.clear(); 90 entry->orderedList.clear();
91 } 91 }
92 92
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 DEFINE_TRACE(DocumentOrderedMap) { 205 DEFINE_TRACE(DocumentOrderedMap) {
206 visitor->trace(m_map); 206 visitor->trace(m_map);
207 } 207 }
208 208
209 DEFINE_TRACE(DocumentOrderedMap::MapEntry) { 209 DEFINE_TRACE(DocumentOrderedMap::MapEntry) {
210 visitor->trace(element); 210 visitor->trace(element);
211 visitor->trace(orderedList); 211 visitor->trace(orderedList);
212 } 212 }
213 213
214 } // namespace blink 214 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp ('k') | third_party/WebKit/Source/core/dom/ElementDataCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698