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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 297293004: Adding cache for security origin validations in 2D/WebGL canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reorganized code Created 6 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: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index eb9dee1de7b0eab5599ca78987e5a8e36e991242..7fcbc34363bef390764de84a81b7b46d972d7b29 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1519,7 +1519,7 @@ void CanvasRenderingContext2D::drawImageInternal(CanvasImageSource* imageSource,
canvas()->buffer()->flush();
}
- if (canvas()->originClean() && imageSource->wouldTaintOrigin(canvas()->securityOrigin()))
+ if (canvas()->originClean() && wouldTaintOrigin(imageSource))
canvas()->setOriginTainted();
didDraw(dirtyRect);
@@ -1694,7 +1694,9 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(CanvasImageSou
}
ASSERT(imageForRendering);
- return CanvasPattern::create(imageForRendering.release(), repeatX, repeatY, !imageSource->wouldTaintOrigin(canvas()->securityOrigin()));
+ bool originClean = !wouldTaintOrigin(imageSource);
+
+ return CanvasPattern::create(imageForRendering.release(), repeatX, repeatY, originClean);
}
bool CanvasRenderingContext2D::computeDirtyRect(const FloatRect& localRect, FloatRect* dirtyRect)
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698