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

Unified Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 1577783003: Revert of Add a origin clean flag in ImageBitmap class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/HTMLVideoElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
index 38bda7926ea21ac560f08d5619230eddac282be7..6847cd14818fe93865e0d8465533e38b48e0f0d8 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -340,7 +340,16 @@
exceptionState.throwDOMException(IndexSizeError, String::format("The source %s provided is 0.", sw ? "height" : "width"));
return ScriptPromise();
}
- return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::create(this, IntRect(sx, sy, sw, sh), eventTarget.toDOMWindow()->document()));
+ if (!hasSingleSecurityOrigin()) {
+ exceptionState.throwSecurityError("The source video contains image data from multiple origins.");
+ return ScriptPromise();
+ }
+ if (!webMediaPlayer()->didPassCORSAccessCheck()
+ && eventTarget.toDOMWindow()->document()->securityOrigin()->taintsCanvas(currentSrc())) {
+ exceptionState.throwSecurityError("Cross-origin access to the source video is denied.");
+ return ScriptPromise();
+ }
+ return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::create(this, IntRect(sx, sy, sw, sh)));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698