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

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: Rebase with master, fix layout test errors 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..8033f3ce927588e63922fd5f7429b0e33921dbe2 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -43,8 +43,18 @@ void OffscreenCanvasRenderingContext2D::setOriginTainted()
bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source)
{
+ if (ScriptState::current(v8::Isolate::GetCurrent())->getExecutionContext()->isWorkerGlobalScope()) {
haraken 2016/04/27 06:30:51 ScriptState::current should not be called outside
+ // 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