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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 void LayoutSVGResourceContainer::registerResource() 226 void LayoutSVGResourceContainer::registerResource()
227 { 227 {
228 SVGDocumentExtensions& extensions = svgExtensionsFromElement(element()); 228 SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
229 if (!extensions.hasPendingResource(m_id)) { 229 if (!extensions.hasPendingResource(m_id)) {
230 extensions.addResource(m_id, this); 230 extensions.addResource(m_id, this);
231 return; 231 return;
232 } 232 }
233 233
234 OwnPtrWillBeRawPtr<SVGDocumentExtensions::SVGPendingElements> clients(extens ions.removePendingResource(m_id)); 234 RawPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions.removeP endingResource(m_id));
235 235
236 // Cache us with the new id. 236 // Cache us with the new id.
237 extensions.addResource(m_id, this); 237 extensions.addResource(m_id, this);
238 238
239 // Update cached resources of pending clients. 239 // Update cached resources of pending clients.
240 for (const auto& pendingClient : *clients) { 240 for (const auto& pendingClient : *clients) {
241 ASSERT(pendingClient->hasPendingResources()); 241 ASSERT(pendingClient->hasPendingResources());
242 extensions.clearHasPendingResourcesIfPossible(pendingClient); 242 extensions.clearHasPendingResourcesIfPossible(pendingClient);
243 LayoutObject* layoutObject = pendingClient->layoutObject(); 243 LayoutObject* layoutObject = pendingClient->layoutObject();
244 if (!layoutObject) 244 if (!layoutObject)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return; 284 return;
285 285
286 SVGElementSet* dependencies = toSVGElement(object->node())->setOfIncomingRef erences(); 286 SVGElementSet* dependencies = toSVGElement(object->node())->setOfIncomingRef erences();
287 if (!dependencies) 287 if (!dependencies)
288 return; 288 return;
289 289
290 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive 290 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive
291 // reference graph adjustments on changes, so we need to break possible cycl es here. 291 // reference graph adjustments on changes, so we need to break possible cycl es here.
292 // This strong reference is safe, as it is guaranteed that this set will be emptied 292 // This strong reference is safe, as it is guaranteed that this set will be emptied
293 // at the end of recursion. 293 // at the end of recursion.
294 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGElementSet>, invalidatingDepen dencies, (adoptPtrWillBeNoop(new SVGElementSet))); 294 DEFINE_STATIC_LOCAL(Persistent<SVGElementSet>, invalidatingDependencies, ((n ew SVGElementSet)));
295 295
296 for (SVGElement* element : *dependencies) { 296 for (SVGElement* element : *dependencies) {
297 if (LayoutObject* layoutObject = element->layoutObject()) { 297 if (LayoutObject* layoutObject = element->layoutObject()) {
298 if (UNLIKELY(!invalidatingDependencies->add(element).isNewEntry)) { 298 if (UNLIKELY(!invalidatingDependencies->add(element).isNewEntry)) {
299 // Reference cycle: we are in process of invalidating this depen dant. 299 // Reference cycle: we are in process of invalidating this depen dant.
300 continue; 300 continue;
301 } 301 }
302 302
303 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidati on(layoutObject, needsLayout); 303 LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidati on(layoutObject, needsLayout);
304 invalidatingDependencies->remove(element); 304 invalidatingDependencies->remove(element);
(...skipping 20 matching lines...) Expand all
325 // This will process the rest of the ancestors. 325 // This will process the rest of the ancestors.
326 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); 326 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache();
327 break; 327 break;
328 } 328 }
329 329
330 current = current->parent(); 330 current = current->parent();
331 } 331 }
332 } 332 }
333 333
334 } // namespace blink 334 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698