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

Unified Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 800113002: Use C++11 range-based for loop in Source/core/inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase again and again! Created 6 years 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
« no previous file with comments | « Source/core/inspector/InspectorState.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 0a8e71d8c6a7f025d5b6aaf9aecc95d6d04db262..a74ed0c9ea58fc8ec9843701865e5693500df1d3 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -560,8 +560,8 @@ PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> > Insp
WillBeHeapVector<InspectorStyleProperty> properties;
populateAllProperties(properties);
- for (WillBeHeapVector<InspectorStyleProperty>::iterator it = properties.begin(), itEnd = properties.end(); it != itEnd; ++it) {
- const CSSPropertySourceData& propertyEntry = it->sourceData;
+ for (auto& property : properties) {
+ const CSSPropertySourceData& propertyEntry = property.sourceData;
RefPtr<TypeBuilder::CSS::CSSComputedStyleProperty> entry = TypeBuilder::CSS::CSSComputedStyleProperty::create()
.setName(propertyEntry.name)
.setValue(propertyEntry.value);
@@ -670,12 +670,12 @@ void InspectorStyle::populateAllProperties(WillBeHeapVector<InspectorStyleProper
RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = extractSourceData();
if (sourceData && sourceData->styleSourceData) {
WillBeHeapVector<CSSPropertySourceData>& sourcePropertyData = sourceData->styleSourceData->propertyData;
- for (WillBeHeapVector<CSSPropertySourceData>::const_iterator it = sourcePropertyData.begin(); it != sourcePropertyData.end(); ++it) {
- InspectorStyleProperty p(*it, true);
+ for (const auto& data : sourcePropertyData) {
+ InspectorStyleProperty p(data, true);
bool isPropertyTextKnown = textForRange(p.sourceData.range, &p.rawText);
ASSERT_UNUSED(isPropertyTextKnown, isPropertyTextKnown);
result.append(p);
- sourcePropertyNames.add(it->name.lower());
+ sourcePropertyNames.add(data.name.lower());
}
}
@@ -701,8 +701,8 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con
WillBeHeapVector<InspectorStyleProperty> properties;
populateAllProperties(properties);
- for (WillBeHeapVector<InspectorStyleProperty>::iterator it = properties.begin(), itEnd = properties.end(); it != itEnd; ++it) {
- const CSSPropertySourceData& propertyEntry = it->sourceData;
+ for (auto& styleProperty : properties) {
+ const CSSPropertySourceData& propertyEntry = styleProperty.sourceData;
const String& name = propertyEntry.name;
RefPtr<TypeBuilder::CSS::CSSProperty> property = TypeBuilder::CSS::CSSProperty::create()
@@ -713,12 +713,12 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con
// Default "parsedOk" == true.
if (!propertyEntry.parsedOk)
property->setParsedOk(false);
- if (it->hasRawText())
- property->setText(it->rawText);
+ if (styleProperty.hasRawText())
+ property->setText(styleProperty.rawText);
if (propertyEntry.important)
property->setImportant(true);
- if (it->hasSource) {
+ if (styleProperty.hasSource) {
property->setRange(buildSourceRangeObject(propertyEntry.range, m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : nullptr));
if (!propertyEntry.disabled) {
ASSERT_UNUSED(sourceData, sourceData);
« no previous file with comments | « Source/core/inspector/InspectorState.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698