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 |