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

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: 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..76bbcc6ffc0c74e3f06483b5dfec672b2c391ef4 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -43,8 +43,17 @@ void OffscreenCanvasRenderingContext2D::setOriginTainted()
bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source)
{
+ if (ScriptState::current(v8::Isolate::GetCurrent())->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(xlai): implement wouldTaintOrigin for OffscreenCanvas2d on main thread
Justin Novosad 2016/04/26 19:50:07 This comment should refer to a crbug
NOTIMPLEMENTED();
- return false;
+ return true;
}
int OffscreenCanvasRenderingContext2D::width() const

Powered by Google App Engine
This is Rietveld 408576698