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

Unified Diff: Source/core/layout/svg/LayoutSVGResourceContainer.cpp

Issue 1062283002: Use C++11 range-based loop for core/layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix it naming Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/svg/LayoutSVGResourceContainer.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
index 49f9c02bc841d1c3b2d773d35c81165cbe7e0d74..27d011d378f9d148f1bf176f1c719ea9074f6ce5 100644
--- a/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -110,9 +110,7 @@ void LayoutSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode
bool needsLayout = mode == LayoutAndBoundariesInvalidation;
bool markForInvalidation = mode != ParentOnlyInvalidation;
- HashSet<LayoutObject*>::iterator end = m_clients.end();
- for (HashSet<LayoutObject*>::iterator it = m_clients.begin(); it != end; ++it) {
- LayoutObject* client = *it;
+ for (auto* client : m_clients) {
if (client->isSVGResourceContainer()) {
toLayoutSVGResourceContainer(client)->removeAllClientsFromCache(markForInvalidation);
continue;
@@ -131,9 +129,8 @@ void LayoutSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode
void LayoutSVGResourceContainer::markAllClientLayersForInvalidation()
{
- HashSet<DeprecatedPaintLayer*>::iterator layerEnd = m_clientLayers.end();
- for (HashSet<DeprecatedPaintLayer*>::iterator it = m_clientLayers.begin(); it != layerEnd; ++it)
- (*it)->filterNeedsPaintInvalidation();
+ for (auto* layer : m_clientLayers)
+ layer->filterNeedsPaintInvalidation();
}
void LayoutSVGResourceContainer::markClientForInvalidation(LayoutObject* client, InvalidationMode mode)
@@ -257,16 +254,15 @@ static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object
typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement>> SVGElementSet;
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGElementSet>, invalidatingDependencies, (adoptPtrWillBeNoop(new SVGElementSet)));
- SVGElementSet::iterator end = dependencies->end();
- for (SVGElementSet::iterator it = dependencies->begin(); it != end; ++it) {
- if (LayoutObject* layoutObject = (*it)->layoutObject()) {
- if (UNLIKELY(!invalidatingDependencies->add(*it).isNewEntry)) {
+ for (auto* element : *dependencies) {
+ if (LayoutObject* layoutObject = element->layoutObject()) {
+ if (UNLIKELY(!invalidatingDependencies->add(element).isNewEntry)) {
// Reference cycle: we are in process of invalidating this dependant.
continue;
}
LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(layoutObject, needsLayout);
- invalidatingDependencies->remove(*it);
+ invalidatingDependencies->remove(element);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698