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 72000926bf2f48aeef54bd80c41870358ee995d4..9ff34e4179bfa36edb4925ce2c0c7cb2bf3c18da 100644 |
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp |
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp |
@@ -5,6 +5,7 @@ |
#include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" |
#include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.h" |
+#include "core/dom/ExecutionContext.h" |
#include "core/frame/ImageBitmap.h" |
#include "core/frame/Settings.h" |
#include "core/workers/WorkerGlobalScope.h" |
@@ -27,20 +28,23 @@ OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D( |
OffscreenCanvas* canvas, |
const CanvasContextCreationAttributes& attrs) |
: CanvasRenderingContext(nullptr, canvas, attrs) { |
- ExecutionContext* executionContext = scriptState->getExecutionContext(); |
- if (executionContext->isDocument()) { |
- if (toDocument(executionContext)->settings()->disableReadingFromCanvas()) |
+ m_executionContext = scriptState->getExecutionContext(); |
+ if (m_executionContext.get()->isDocument()) { |
+ if (toDocument(m_executionContext.get()) |
+ ->settings() |
+ ->disableReadingFromCanvas()) |
canvas->setDisableReadingFromCanvasTrue(); |
return; |
} |
WorkerSettings* workerSettings = |
- toWorkerGlobalScope(executionContext)->workerSettings(); |
+ toWorkerGlobalScope(m_executionContext.get())->workerSettings(); |
if (workerSettings && workerSettings->disableReadingFromCanvas()) |
canvas->setDisableReadingFromCanvasTrue(); |
} |
DEFINE_TRACE(OffscreenCanvasRenderingContext2D) { |
+ visitor->trace(m_executionContext); |
CanvasRenderingContext::trace(visitor); |
BaseRenderingContext2D::trace(visitor); |
} |