Index: third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
index 4c30861ef7c573338193634985326ede43e9da06..bcd0143e15a4e838b9a3637845c2de256e5e32c1 100644 |
--- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
+++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
@@ -37,6 +37,13 @@ void HTMLCanvasElementModule::getContext( |
OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreen( |
HTMLCanvasElement& canvas, |
ExceptionState& exceptionState) { |
+ if (!!canvas.surfaceLayerBridge()) { |
Justin Novosad
2016/11/02 20:00:11
No need for !!
xlai (Olivia)
2016/11/02 20:07:50
Done.
|
+ exceptionState.throwDOMException( |
+ InvalidStateError, |
+ "Cannot transfer control from a canvas for more than one time."); |
+ return nullptr; |
+ } |
+ |
if (!canvas.createSurfaceLayer()) { |
exceptionState.throwDOMException( |
V8Error, |