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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp

Issue 1863793003: Make CSSValuePool thread local to ensure correct parsing in colors on workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master Created 4 years, 8 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: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
index 4eb704ab21073588573eab840d21a7941942430a..861b443c6eee40e03f79fffba4039538dc1adb26 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -437,7 +437,7 @@ static bool fastParseColorInternal(RGBA32& rgb, const CharacterType* characters,
return false;
}
-RawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserMode parserMode)
+RawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserMode parserMode, CSSValuePool* cssValuePool)
{
ASSERT(!string.isEmpty());
CSSParserString cssString;
@@ -446,7 +446,7 @@ RawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserM
if (CSSPropertyParser::isColorKeyword(valueID)) {
if (!isValueAllowedInMode(valueID, parserMode))
return nullptr;
- return cssValuePool().createIdentifierValue(valueID);
+ return cssValuePool->createIdentifierValue(valueID);
}
RGBA32 color;
@@ -460,7 +460,7 @@ RawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserM
parseResult = fastParseColorInternal(color, string.characters16(), string.length(), quirksMode);
if (!parseResult)
return nullptr;
- return cssValuePool().createColorValue(color);
+ return cssValuePool->createColorValue(color);
}
bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID)
@@ -1021,12 +1021,12 @@ static RawPtr<CSSValue> parseSimpleTransform(CSSPropertyID propertyID, const Str
return parseSimpleTransformList(pos, end);
}
-RawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode)
+RawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String& string, CSSParserMode parserMode, CSSValuePool* localCSSValuePool)
{
if (RawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode))
return length.release();
if (isColorPropertyID(propertyID))
- return parseColor(string, parserMode);
+ return parseColor(string, parserMode, localCSSValuePool);
if (RawPtr<CSSValue> keyword = parseKeywordValue(propertyID, string))
return keyword.release();
if (RawPtr<CSSValue> transform = parseSimpleTransform(propertyID, string))
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698