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

Unified Diff: Source/core/css/parser/CSSParserFastPaths.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 and oilpan feedback Created 5 years, 6 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
Index: Source/core/css/parser/CSSParserFastPaths.cpp
diff --git a/Source/core/css/parser/CSSParserFastPaths.cpp b/Source/core/css/parser/CSSParserFastPaths.cpp
index caa105f12a68d330a705e923159308a5a1dc6585..17ee297e621d6956a4e33bed4b337d1ff6d3b97f 100644
--- a/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -85,7 +85,7 @@ static inline bool parseSimpleLength(const CharacterType* characters, unsigned l
return ok;
}
-static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleLengthValue(CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode)
+static NullableCSSValue parseSimpleLengthValue(CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode)
{
ASSERT(!string.isEmpty());
bool acceptsNegativeNumbers = false;
@@ -452,7 +452,7 @@ bool CSSParserFastPaths::parseColorAsRGBA32(RGBA32& rgb, const String& name, boo
return true;
}
-static PassRefPtrWillBeRawPtr<CSSValue> parseColor(const String& string, bool quirksMode)
+static NullableCSSValue parseColor(const String& string, bool quirksMode)
{
ASSERT(!string.isEmpty());
CSSParserString cssString;
@@ -762,7 +762,7 @@ bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
}
}
-static PassRefPtrWillBeRawPtr<CSSValue> parseKeywordValue(CSSPropertyID propertyId, const String& string)
+static NullableCSSValue parseKeywordValue(CSSPropertyID propertyId, const String& string)
{
ASSERT(!string.isEmpty());
@@ -939,7 +939,7 @@ static PassRefPtrWillBeRawPtr<CSSValueList> parseSimpleTransformList(CharType*&
return transformList.release();
}
-static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleTransform(CSSPropertyID propertyID, const String& string)
+static NullableCSSValue parseSimpleTransform(CSSPropertyID propertyID, const String& string)
{
ASSERT(!string.isEmpty());
@@ -955,16 +955,16 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleTransform(CSSPropertyID prope
return parseSimpleTransformList(pos, end);
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
+NullableCSSValue CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
{
- if (RefPtrWillBeRawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode))
- return length.release();
+ if (NullableCSSValue length = parseSimpleLengthValue(propertyID, string, parserMode))
+ return length;
if (isColorPropertyID(propertyID))
return parseColor(string, isQuirksModeBehavior(parserMode));
- if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, string))
- return keyword.release();
- if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID, string))
- return transform.release();
+ if (NullableCSSValue keyword = parseKeywordValue(propertyID, string))
+ return keyword;
+ if (NullableCSSValue transform = parseSimpleTransform(propertyID, string))
+ return transform;
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698