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

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: 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..e20ca480ba77bcfaefd668c2aa91bdef1d27b604 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,14 @@ bool CanvasRenderingContext::wouldTaintOrigin(CanvasImageSource* imageSource)
return true;
}
- bool taintOrigin = imageSource->wouldTaintOrigin(canvas()->getSecurityOrigin());
+ bool taintOrigin;
+ if (!!canvas()) {
Justin Novosad 2016/05/05 14:56:16 I think this bit of code could be made simpler: A
+ taintOrigin = imageSource->wouldTaintOrigin(canvas()->getSecurityOrigin());
+ } else {
+ // The function must be called from OffscreenCanvas context then.
+ ASSERT(!!getOffscreenCanvas());
+ taintOrigin = imageSource->wouldTaintOrigin(destinationSecurityOrigin);
+ }
if (hasURL) {
if (taintOrigin)

Powered by Google App Engine
This is Rietveld 408576698