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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 1249553002: CSSValue Immediates: Add move operators to CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_3_tagged_ptrs_with_copy_ops_mv_operators_ref_primvalue
Patch Set: Rebase Created 5 years, 5 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
« no previous file with comments | « no previous file | Source/core/animation/ColorStyleInterpolation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index f81146183a93a6c193ff1d61f0148eb08d9aa21d..619df5e4c53a063661bd1237987de7e159957f42 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -142,7 +142,7 @@ namespace blink {
if (!value.isPrimitiveValue())
return;
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
if (primitiveValue.getValueID() == {{auto_identity}})
state.style()->{{auto_setter}}();
else
@@ -350,16 +350,16 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
int length = list.length();
for (int i = 0; i < length; ++i) {
- CSSValue currValue = list.item(i);
+ const CSSValue& currValue = list.item(i);
if (!currValue.isPrimitiveValue())
continue;
Pair* pair = toCSSPrimitiveValue(currValue).getPairValue();
- if (!pair || !pair->first() || !pair->second())
+ if (!pair)
continue;
- AtomicString identifier(pair->first()->getStringValue());
- int value = pair->second()->getIntValue();
+ AtomicString identifier(pair->first().getStringValue());
+ int value = pair->second().getIntValue();
CounterDirectives& directives = map.add(identifier, CounterDirectives()).storedValue->value;
{% if action == 'Reset' %}
directives.setResetValue(value);
@@ -513,23 +513,23 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
{{declare_value_function(property_id)}}
{
String url;
- CSSValue valueToUse = value;
- if (valueToUse.isValueList()) {
- CSSValueList& list = toCSSValueList(valueToUse);
+ CSSValue realValue = value;
+ if (realValue.isValueList()) {
+ const CSSValueList& list = toCSSValueList(realValue);
ASSERT(list.length() > 1);
if (!list.item(0).isPrimitiveValue())
return;
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(list.item(0));
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(list.item(0));
if (!primitiveValue.isURI())
return;
url = primitiveValue.getStringValue();
- valueToUse = list.item(1);
+ realValue = list.item(1);
}
- if (valueToUse.isPrimitiveValue()) {
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(valueToUse);
+ if (realValue.isPrimitiveValue()) {
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(realValue);
Color color;
SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
if (primitiveValue.getValueID() == CSSValueNone) {
@@ -541,7 +541,7 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
color = state.style()->color();
paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
} else {
- color = StyleBuilderConverter::convertColor(state, valueToUse);
+ color = StyleBuilderConverter::convertColor(state, realValue);
paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
}
{{set_value(property)}}(paintType, color, url,
« no previous file with comments | « no previous file | Source/core/animation/ColorStyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698