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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 2490443002: Make OffscreenCanvas an EventTarget (Closed)
Patch Set: tests added Created 4 years, 1 month 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698