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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 1919363002: Add createGradient and createPattern to OffscreenCanvas2D in worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScriptState 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 d8fc5499e8353cd8b66d41b603d308331e675cc1..4a60e82c253a096955c994eb4a863490d0a88732 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -41,10 +41,20 @@ void OffscreenCanvasRenderingContext2D::setOriginTainted()
m_originClean = false;
}
-bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source)
-{
+bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source, ScriptState* scriptState)
+{
+ if (scriptState->getExecutionContext()->isWorkerGlobalScope()) {
+ // Currently, we only support passing in ImageBitmap as source image in
+ // drawImage() or createPattern() in a OffscreenCanvas2d in worker.
+ ASSERT(source->isImageBitmap());
+ // ImageBitmap wouldTaintOrigin doesn't consider destinationSecurityOrigin.
+ return source->wouldTaintOrigin(nullptr);
+ }
+
+ // TODO(crbug.com/606925): implement wouldTaintOrigin for OffscreenCanvas2d
+ // on main thread
NOTIMPLEMENTED();
- return false;
+ return true;
}
int OffscreenCanvasRenderingContext2D::width() const

Powered by Google App Engine
This is Rietveld 408576698