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

Unified Diff: third_party/WebKit/Source/core/css/CSSValuePool.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/CSSValuePool.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSValuePool.cpp b/third_party/WebKit/Source/core/css/CSSValuePool.cpp
index 12c18bcac68ca040c43b877657f1014237f302e8..73f4b77a9a40e1e4ba7f2f52f94a7fff65101136 100644
--- a/third_party/WebKit/Source/core/css/CSSValuePool.cpp
+++ b/third_party/WebKit/Source/core/css/CSSValuePool.cpp
@@ -34,6 +34,7 @@ namespace blink {
CSSValuePool& cssValuePool()
{
+ DCHECK(isMainThread());
DEFINE_STATIC_LOCAL(CSSValuePool, pool, (new CSSValuePool));
return pool;
}
@@ -79,14 +80,6 @@ RawPtr<CSSColorValue> CSSValuePool::createColorValue(RGBA32 rgbValue)
if (rgbValue == Color::black)
return m_colorBlack;
- if (!isMainThread()) {
- // TODO (crbug.com/599659): Make CSS color parsing work properly in a
- // worker thread.
- // Currently, ColorValueCache is not thread-safe; so we avoid interacting
- // with it on a non-main thread.
- return CSSColorValue::create(rgbValue);
- }
-
// Just wipe out the cache and start rebuilding if it gets too big.
const unsigned maximumColorCacheSize = 512;
if (m_colorValueCache.size() > maximumColorCacheSize)
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValuePool.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698