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

Unified Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp

Issue 1954533002: Implement wouldTaintOrigin and expose createPattern for OCRC2D on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OCRC2D pattern is working fine in GPU; remove Failure mark in TestExpectations Created 4 years, 7 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/html/canvas/CanvasRenderingContext.cpp
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
index 17c1e8141a4f7ca44c039811abf997ab3a304a68..fc9536545f53274c6cdfb7cb46af643c6a3aece5 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
@@ -60,7 +60,7 @@ CanvasRenderingContext::ContextType CanvasRenderingContext::resolveContextTypeAl
return type;
}
-bool CanvasRenderingContext::wouldTaintOrigin(CanvasImageSource* imageSource)
+bool CanvasRenderingContext::wouldTaintOrigin(CanvasImageSource* imageSource, SecurityOrigin* destinationSecurityOrigin)
{
const KURL& sourceURL = imageSource->sourceURL();
bool hasURL = (sourceURL.isValid() && !sourceURL.isAboutBlankURL());
@@ -72,7 +72,8 @@ bool CanvasRenderingContext::wouldTaintOrigin(CanvasImageSource* imageSource)
return true;
}
- bool taintOrigin = imageSource->wouldTaintOrigin(canvas()->getSecurityOrigin());
+ ASSERT(!canvas() == !!destinationSecurityOrigin); // Must have one or the other
+ bool taintOrigin = imageSource->wouldTaintOrigin(destinationSecurityOrigin ? destinationSecurityOrigin : canvas()->getSecurityOrigin());
if (hasURL) {
if (taintOrigin)

Powered by Google App Engine
This is Rietveld 408576698