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

Unified Diff: third_party/WebKit/Source/core/dom/ExecutionContext.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/dom/ExecutionContext.cpp
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
index a190bcd84b65555f3a930c0c1d95ee16ebf591c1..0cc85456837f076a4b3104afa4884f89cacb375e 100644
--- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
+++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -273,9 +273,22 @@ void ExecutionContext::removeURLFromMemoryCache(const KURL& url)
memoryCache()->removeURLFromCache(url);
}
+CSSValuePool* ExecutionContext::localCssValuePool()
+{
+ // Local CSS caches are only for worker threads.
+ if (!this->isWorkerGlobalScope())
+ return nullptr;
+
+ // Lazily initialization to avoid unnecessary CSS caches.
+ if (!m_localCssValuePool)
+ m_localCssValuePool = new CSSValuePool();
+ return m_localCssValuePool;
+}
+
DEFINE_TRACE(ExecutionContext)
{
visitor->trace(m_publicURLManager);
+ visitor->trace(m_localCssValuePool);
ContextLifecycleNotifier::trace(visitor);
Supplementable<ExecutionContext>::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | third_party/WebKit/Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698