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

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 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/CSSParserFastPaths.h ('k') | Source/core/css/parser/CSSParserImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSParserFastPaths.cpp
diff --git a/Source/core/css/parser/CSSParserFastPaths.cpp b/Source/core/css/parser/CSSParserFastPaths.cpp
index 1605e16ccaa9e4e15cfc124d6517e8ba77104726..4571171d3ea7a6e49d37531658c37c5399dffd13 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;
@@ -428,7 +428,7 @@ static bool fastParseColorInternal(RGBA32& rgb, const CharacterType* characters,
return false;
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, bool quirksMode)
+NullableCSSValue CSSParserFastPaths::parseColor(const String& string, bool quirksMode)
{
ASSERT(!string.isEmpty());
CSSParserString cssString;
@@ -749,7 +749,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());
@@ -926,7 +926,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());
@@ -942,16 +942,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;
}
« no previous file with comments | « Source/core/css/parser/CSSParserFastPaths.h ('k') | Source/core/css/parser/CSSParserImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698