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

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

Issue 2703833002: Migrate WTF::HashSet::remove() to ::erase() [part 2] (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeSorter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 bool shouldUpdateTimer = false; 95 bool shouldUpdateTimer = false;
96 96
97 for (const auto& selector : removedSelectors) { 97 for (const auto& selector : removedSelectors) {
98 if (!m_matchingCallbackSelectors.remove(selector)) 98 if (!m_matchingCallbackSelectors.remove(selector))
99 continue; 99 continue;
100 100
101 // Count reached 0. 101 // Count reached 0.
102 shouldUpdateTimer = true; 102 shouldUpdateTimer = true;
103 auto it = m_addedSelectors.find(selector); 103 auto it = m_addedSelectors.find(selector);
104 if (it != m_addedSelectors.end()) 104 if (it != m_addedSelectors.end())
105 m_addedSelectors.remove(it); 105 m_addedSelectors.erase(it);
106 else 106 else
107 m_removedSelectors.insert(selector); 107 m_removedSelectors.insert(selector);
108 } 108 }
109 109
110 for (const auto& selector : addedSelectors) { 110 for (const auto& selector : addedSelectors) {
111 HashCountedSet<String>::AddResult result = 111 HashCountedSet<String>::AddResult result =
112 m_matchingCallbackSelectors.add(selector); 112 m_matchingCallbackSelectors.add(selector);
113 if (!result.isNewEntry) 113 if (!result.isNewEntry)
114 continue; 114 continue;
115 115
116 shouldUpdateTimer = true; 116 shouldUpdateTimer = true;
117 auto it = m_removedSelectors.find(selector); 117 auto it = m_removedSelectors.find(selector);
118 if (it != m_removedSelectors.end()) 118 if (it != m_removedSelectors.end())
119 m_removedSelectors.remove(it); 119 m_removedSelectors.erase(it);
120 else 120 else
121 m_addedSelectors.insert(selector); 121 m_addedSelectors.insert(selector);
122 } 122 }
123 123
124 if (!shouldUpdateTimer) 124 if (!shouldUpdateTimer)
125 return; 125 return;
126 126
127 if (m_removedSelectors.isEmpty() && m_addedSelectors.isEmpty()) { 127 if (m_removedSelectors.isEmpty() && m_addedSelectors.isEmpty()) {
128 if (m_callbackSelectorChangeTimer.isActive()) { 128 if (m_callbackSelectorChangeTimer.isActive()) {
129 m_timerExpirations = 0; 129 m_timerExpirations = 0;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 supplementable()->styleEngine().watchedSelectorsChanged(); 168 supplementable()->styleEngine().watchedSelectorsChanged();
169 } 169 }
170 170
171 DEFINE_TRACE(CSSSelectorWatch) { 171 DEFINE_TRACE(CSSSelectorWatch) {
172 visitor->trace(m_watchedCallbackSelectors); 172 visitor->trace(m_watchedCallbackSelectors);
173 Supplement<Document>::trace(visitor); 173 Supplement<Document>::trace(visitor);
174 } 174 }
175 175
176 } // namespace blink 176 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeSorter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698