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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // Invalidate paint properties to update effects if any. 179 // Invalidate paint properties to update effects if any.
180 client->setNeedsPaintPropertyUpdate(); 180 client->setNeedsPaintPropertyUpdate();
181 break; 181 break;
182 case ParentOnlyInvalidation: 182 case ParentOnlyInvalidation:
183 break; 183 break;
184 } 184 }
185 } 185 }
186 186
187 void LayoutSVGResourceContainer::addClient(LayoutObject* client) { 187 void LayoutSVGResourceContainer::addClient(LayoutObject* client) {
188 ASSERT(client); 188 ASSERT(client);
189 m_clients.add(client); 189 m_clients.insert(client);
190 clearInvalidationMask(); 190 clearInvalidationMask();
191 } 191 }
192 192
193 void LayoutSVGResourceContainer::removeClient(LayoutObject* client) { 193 void LayoutSVGResourceContainer::removeClient(LayoutObject* client) {
194 ASSERT(client); 194 ASSERT(client);
195 removeClientFromCache(client, false); 195 removeClientFromCache(client, false);
196 m_clients.remove(client); 196 m_clients.remove(client);
197 } 197 }
198 198
199 void LayoutSVGResourceContainer::invalidateCacheAndMarkForLayout( 199 void LayoutSVGResourceContainer::invalidateCacheAndMarkForLayout(
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid 262 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid
263 // expensive reference graph adjustments on changes, so we need to break 263 // expensive reference graph adjustments on changes, so we need to break
264 // possible cycles here. 264 // possible cycles here.
265 // This strong reference is safe, as it is guaranteed that this set will be 265 // This strong reference is safe, as it is guaranteed that this set will be
266 // emptied at the end of recursion. 266 // emptied at the end of recursion.
267 DEFINE_STATIC_LOCAL(SVGElementSet, invalidatingDependencies, 267 DEFINE_STATIC_LOCAL(SVGElementSet, invalidatingDependencies,
268 (new SVGElementSet)); 268 (new SVGElementSet));
269 269
270 for (SVGElement* element : *dependencies) { 270 for (SVGElement* element : *dependencies) {
271 if (LayoutObject* layoutObject = element->layoutObject()) { 271 if (LayoutObject* layoutObject = element->layoutObject()) {
272 if (UNLIKELY(!invalidatingDependencies.add(element).isNewEntry)) { 272 if (UNLIKELY(!invalidatingDependencies.insert(element).isNewEntry)) {
273 // Reference cycle: we are in process of invalidating this dependant. 273 // Reference cycle: we are in process of invalidating this dependant.
274 continue; 274 continue;
275 } 275 }
276 276
277 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation( 277 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(
278 layoutObject, needsLayout); 278 layoutObject, needsLayout);
279 invalidatingDependencies.remove(element); 279 invalidatingDependencies.remove(element);
280 } 280 }
281 } 281 }
282 } 282 }
(...skipping 19 matching lines...) Expand all
302 // This will process the rest of the ancestors. 302 // This will process the rest of the ancestors.
303 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); 303 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache();
304 break; 304 break;
305 } 305 }
306 306
307 current = current->parent(); 307 current = current->parent();
308 } 308 }
309 } 309 }
310 310
311 } // namespace blink 311 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/TextAutosizer.cpp ('k') | third_party/WebKit/Source/core/layout/svg/SVGResources.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698