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

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! 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
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 5ffd4aa55fd1002ae8289139e59766d8c135fe92..a83548fd4254ee0b00e11855a95b51ee79b2c63e 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -559,8 +559,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 it : properties) {
+ const CSSPropertySourceData& propertyEntry = it.sourceData;
RefPtr<TypeBuilder::CSS::CSSComputedStyleProperty> entry = TypeBuilder::CSS::CSSComputedStyleProperty::create()
.setName(propertyEntry.name)
.setValue(propertyEntry.value);
@@ -669,12 +669,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& it : sourcePropertyData) {
+ InspectorStyleProperty p(it, true);
bool isPropertyTextKnown = textForRange(p.sourceData.range, &p.rawText);
ASSERT_UNUSED(isPropertyTextKnown, isPropertyTextKnown);
result.append(p);
- sourcePropertyNames.add(it->name.lower());
+ sourcePropertyNames.add(it.name.lower());
}
}
@@ -700,8 +700,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 it : properties) {
+ const CSSPropertySourceData& propertyEntry = it.sourceData;
const String& name = propertyEntry.name;
RefPtr<TypeBuilder::CSS::CSSProperty> property = TypeBuilder::CSS::CSSProperty::create()
@@ -712,12 +712,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 (it.hasRawText())
+ property->setText(it.rawText);
if (propertyEntry.important)
property->setImportant(true);
- if (it->hasSource) {
+ if (it.hasSource) {
property->setRange(buildSourceRangeObject(propertyEntry.range, m_parentStyleSheet ? m_parentStyleSheet->lineEndings() : nullptr));
if (!propertyEntry.disabled) {
ASSERT_UNUSED(sourceData, sourceData);

Powered by Google App Engine
This is Rietveld 408576698