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..d926f6df84ef79c47191533d068d7022d03407e5 100644 |
--- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
+++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp |
@@ -37,18 +37,20 @@ void HTMLCanvasElementModule::getContext( |
OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreen( |
HTMLCanvasElement& canvas, |
ExceptionState& exceptionState) { |
- if (!canvas.createSurfaceLayer()) { |
+ int canvasId = DOMNodeIds::idForNode(&canvas); |
+ if (!canvas.createSurfaceLayer(canvasId)) { |
exceptionState.throwDOMException( |
V8Error, |
"Offscreen canvas creation failed due to an internal timeout."); |
return nullptr; |
} |
- return transferControlToOffscreenInternal(canvas, exceptionState); |
+ return transferControlToOffscreenInternal(canvas, canvasId, exceptionState); |
} |
OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreenInternal( |
HTMLCanvasElement& canvas, |
+ int canvasId, |
ExceptionState& exceptionState) { |
if (canvas.renderingContext()) { |
exceptionState.throwDOMException( |
@@ -58,7 +60,7 @@ OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreenInternal( |
} |
OffscreenCanvas* offscreenCanvas = |
OffscreenCanvas::create(canvas.width(), canvas.height()); |
- offscreenCanvas->setAssociatedCanvasId(DOMNodeIds::idForNode(&canvas)); |
+ offscreenCanvas->setAssociatedCanvasId(canvasId); |
CanvasSurfaceLayerBridge* bridge = canvas.surfaceLayerBridge(); |
if (bridge) { |