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

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

Issue 2796163002: Migrate WTF::HashCountedSet::add() to ::insert() (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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
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.insert(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.erase(it); 119 m_removedSelectors.erase(it);
120 else 120 else
121 m_addedSelectors.insert(selector); 121 m_addedSelectors.insert(selector);
122 } 122 }
(...skipping 44 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