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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.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/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
index 9edb535defc4a6739f1ea51fe171b6be192435b0..86a6c823694c740660f7502c252ddd10c768c8d3 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -26,6 +26,7 @@ OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(OffscreenCa
DEFINE_TRACE(OffscreenCanvasRenderingContext2D)
{
+ visitor->trace(m_executionContext);
OffscreenCanvasRenderingContext::trace(visitor);
BaseRenderingContext2D::trace(visitor);
}
@@ -87,6 +88,14 @@ RawPtr<ImageBitmap> OffscreenCanvasRenderingContext2D::transferToImageBitmap(Exc
bool OffscreenCanvasRenderingContext2D::parseColorOrCurrentColor(Color& color, const String& colorString) const
{
+ if (!m_executionContext)
+ const_cast<OffscreenCanvasRenderingContext2D*>(this)->m_executionContext = ScriptState::current(v8::Isolate::GetCurrent())->getExecutionContext();
+
+ DCHECK(m_executionContext);
+ if (m_executionContext->isWorkerGlobalScope()) {
+ return ::blink::parseColorOrCurrentColor(color, colorString, nullptr, m_executionContext->localCssValuePool());
+ }
+
return ::blink::parseColorOrCurrentColor(color, colorString, nullptr);
}

Powered by Google App Engine
This is Rietveld 408576698