Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
index b29be4df2562f67099e7aa9968280a82a549d3fe..701bf8908661eca7f92c28c2bf747daaa525a3d7 100644 |
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp |
@@ -12,14 +12,16 @@ |
namespace blink { |
-OffscreenCanvas::OffscreenCanvas(const IntSize& size) |
- : m_size(size) |
+OffscreenCanvas::OffscreenCanvas(ExecutionContext* executionContext, const IntSize& size) |
+ : m_executionContext(executionContext) |
Justin Novosad
2016/04/28 19:38:12
If haraken thinks this is safe, I am Okay with it,
|
+ , m_size(size) |
+ , m_originClean(true) |
{ |
} |
-OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height) |
+OffscreenCanvas* OffscreenCanvas::create(ExecutionContext* executionContext, unsigned width, unsigned height) |
{ |
- return new OffscreenCanvas(IntSize(clampTo<int>(width), clampTo<int>(height))); |
+ return new OffscreenCanvas(executionContext, IntSize(clampTo<int>(width), clampTo<int>(height))); |
} |
void OffscreenCanvas::setWidth(unsigned width) |
@@ -102,9 +104,22 @@ void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<CanvasRendering |
renderingContextFactories()[type] = std::move(renderingContextFactory); |
} |
+bool OffscreenCanvas::originClean() const |
+{ |
+ // TODO(crbug.com/607575): Make Settings accessable in worker and use |
+ // disableReadingFromCanvas to determine originClean value. |
+ return m_originClean; |
+} |
+ |
+SecurityOrigin* OffscreenCanvas::getSecurityOrigin() const |
+{ |
+ return getExecutionContext()->getSecurityOrigin(); |
+} |
+ |
DEFINE_TRACE(OffscreenCanvas) |
{ |
visitor->trace(m_context); |
+ visitor->trace(m_executionContext); |
} |
} // namespace blink |