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

Unified Diff: Source/modules/imagebitmap/ImageBitmapFactories.cpp

Issue 318923004: Eliminate MediaPlayer & MediaPlayerClient abstractions(readystate) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 years, 6 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/platform/graphics/media/MediaPlayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
index d399668aab74882b0fd9dc82ebf5036366c28b0d..38be61725f830648ec68dc7202287b4fd8b0fae4 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
@@ -124,15 +124,11 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
// This variant does not work in worker threads.
ASSERT(eventTarget.toDOMWindow());
- if (!video->player()) {
- exceptionState.throwDOMException(InvalidStateError, "No player can be retrieved from the provided video element.");
- return ScriptPromise();
- }
if (video->networkState() == HTMLMediaElement::NETWORK_EMPTY) {
exceptionState.throwDOMException(InvalidStateError, "The provided element has not retrieved data.");
return ScriptPromise();
}
- if (video->player()->readyState() <= MediaPlayer::HaveMetadata) {
+ if (video->readyState() <= HTMLMediaElement::HAVE_METADATA) {
exceptionState.throwDOMException(InvalidStateError, "The provided element's player has no current data.");
return ScriptPromise();
}
@@ -144,7 +140,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
exceptionState.throwSecurityError("The source video contains image data from multiple origins.");
return ScriptPromise();
}
- if (!(video->webMediaPlayer() && video->webMediaPlayer()->didPassCORSAccessCheck())
+ if (!video->webMediaPlayer()->didPassCORSAccessCheck()
&& eventTarget.toDOMWindow()->document()->securityOrigin()->taintsCanvas(video->currentSrc())) {
exceptionState.throwSecurityError("Cross-origin access to the source video is denied.");
return ScriptPromise();
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/platform/graphics/media/MediaPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698