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

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

Issue 2799573003: Migrate WTF::HashCountedSet::remove() to ::erase() (Closed)
Patch Set: Created 3 years, 8 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) 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 m_removedSelectors.clear(); 88 m_removedSelectors.clear();
89 m_timerExpirations = 0; 89 m_timerExpirations = 0;
90 } 90 }
91 91
92 void CSSSelectorWatch::updateSelectorMatches( 92 void CSSSelectorWatch::updateSelectorMatches(
93 const Vector<String>& removedSelectors, 93 const Vector<String>& removedSelectors,
94 const Vector<String>& addedSelectors) { 94 const Vector<String>& addedSelectors) {
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.erase(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.erase(it); 105 m_addedSelectors.erase(it);
106 else 106 else
107 m_removedSelectors.insert(selector); 107 m_removedSelectors.insert(selector);
108 } 108 }
(...skipping 58 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

Powered by Google App Engine
This is Rietveld 408576698