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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 1928043002: Add drawImage() originClean() getSecurityOrigin() to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master and Edited based on haraken's comment Created 4 years, 8 months 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/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

Powered by Google App Engine
This is Rietveld 408576698