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

Unified Diff: Source/core/css/BasicShapeFunctions.cpp

Issue 1233363002: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
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 | « Source/core/animation/animatable/AnimatableUnknown.h ('k') | Source/core/css/CSSBasicShapes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/BasicShapeFunctions.cpp
diff --git a/Source/core/css/BasicShapeFunctions.cpp b/Source/core/css/BasicShapeFunctions.cpp
index 5eb0551bca491aae11e08e580c8b8fe7ec4a278a..e28bbba7c559cdf7a4f1193076685349d9218727 100644
--- a/Source/core/css/BasicShapeFunctions.cpp
+++ b/Source/core/css/BasicShapeFunctions.cpp
@@ -129,14 +129,14 @@ CSSValue valueForBasicShape(const ComputedStyle& style, const BasicShape* basicS
return pool.createValue(basicShapeValue.release());
}
-static Length convertToLength(const StyleResolverState& state, NullableCSSValue value)
+static Length convertToLength(const StyleResolverState& state, const NullableCSSValue& value)
{
if (!value)
return Length(0, Fixed);
return toCSSPrimitiveValue(*value).convertToLength(state.cssToLengthConversionData());
}
-static LengthSize convertToLengthSize(const StyleResolverState& state, NullableCSSValue value)
+static LengthSize convertToLengthSize(const StyleResolverState& state, const NullableCSSValue& value)
{
if (!value)
return LengthSize(Length(0, Fixed), Length(0, Fixed));
@@ -145,7 +145,7 @@ static LengthSize convertToLengthSize(const StyleResolverState& state, NullableC
return LengthSize(convertToLength(state, pair->first()), convertToLength(state, pair->second()));
}
-static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverState& state, NullableCSSValue value)
+static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverState& state, const NullableCSSValue& value)
{
BasicShapeCenterCoordinate::Direction direction;
Length offset = Length(0, Fixed);
@@ -156,7 +156,7 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverS
} else if (toCSSPrimitiveValue(*value).isValueID()) {
keyword = toCSSPrimitiveValue(*value).getValueID();
} else if (Pair* pair = toCSSPrimitiveValue(*value).getPairValue()) {
- keyword = toCSSPrimitiveValue(*pair->first()).getValueID();
+ keyword = pair->first().getValueID();
offset = convertToLength(state, pair->second());
} else {
offset = convertToLength(state, value);
@@ -184,7 +184,7 @@ static BasicShapeCenterCoordinate convertToCenterCoordinate(const StyleResolverS
return BasicShapeCenterCoordinate(direction, offset);
}
-static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, NullableCSSValue radius)
+static BasicShapeRadius cssValueToBasicShapeRadius(const StyleResolverState& state, const NullableCSSValue& radius)
{
if (!radius)
return BasicShapeRadius(BasicShapeRadius::ClosestSide);
« no previous file with comments | « Source/core/animation/animatable/AnimatableUnknown.h ('k') | Source/core/css/CSSBasicShapes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698