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

Unified Diff: Source/core/css/parser/CSSParser.cpp

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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/css/parser/CSSParser.h ('k') | Source/core/css/parser/CSSParserFastPaths.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSParser.cpp
diff --git a/Source/core/css/parser/CSSParser.cpp b/Source/core/css/parser/CSSParser.cpp
index fcda0c40ff1961871cf10cdc2424dfede902f775..a2e447d447c2c014acbae78a3dd796d812a86a09 100644
--- a/Source/core/css/parser/CSSParser.cpp
+++ b/Source/core/css/parser/CSSParser.cpp
@@ -56,9 +56,9 @@ bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
if (string.isEmpty())
return false;
CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
- RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode);
+ NullableCSSValue value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode);
if (value)
- return declaration->setProperty(CSSProperty(resolvedProperty, value.release(), important));
+ return declaration->setProperty(CSSProperty(resolvedProperty, *value, important));
CSSParserContext context(parserMode, 0);
if (styleSheet) {
context = styleSheet->parserContext();
@@ -72,11 +72,11 @@ bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
return CSSParserImpl::parseValue(declaration, unresolvedProperty, string, important, context);
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context)
+NullableCSSValue CSSParser::parseSingleValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context)
{
if (string.isEmpty())
return nullptr;
- if (RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode()))
+ if (NullableCSSValue value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode()))
return value;
RefPtrWillBeRawPtr<MutableStylePropertySet> stylePropertySet = MutableStylePropertySet::create();
bool changed = parseValue(stylePropertySet.get(), propertyID, string, false, context);
@@ -120,7 +120,7 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
return true;
}
- RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, !strict);
+ NullableCSSValue value = CSSParserFastPaths::parseColor(string, !strict);
// TODO(timloh): Why is this always strict mode?
if (!value)
value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContext());
@@ -128,7 +128,7 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
if (!value || !value->isPrimitiveValue())
return false;
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
if (!primitiveValue->isRGBColor())
return false;
@@ -159,7 +159,7 @@ bool CSSParser::parseSystemColor(RGBA32& color, const String& colorString)
return true;
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context)
+NullableCSSValue CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context)
{
StringBuilder builder;
builder.appendLiteral("@font-face { ");
« no previous file with comments | « Source/core/css/parser/CSSParser.h ('k') | Source/core/css/parser/CSSParserFastPaths.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698