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

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: 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
Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
index d399668aab74882b0fd9dc82ebf5036366c28b0d..ad353de746110acd480b6ec254eed09a595d29c4 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
@@ -124,7 +124,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
// This variant does not work in worker threads.
ASSERT(eventTarget.toDOMWindow());
- if (!video->player()) {
+ if (!video->webMediaPlayer()) {
acolwell GONE FROM CHROMIUM 2014/06/06 05:51:09 I don't think you will need this given that the <=
Srirama 2014/06/06 06:41:42 Done.
exceptionState.throwDOMException(InvalidStateError, "No player can be retrieved from the provided video element.");
return ScriptPromise();
}
@@ -132,7 +132,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
exceptionState.throwDOMException(InvalidStateError, "The provided element has not retrieved data.");
return ScriptPromise();
}
- if (video->player()->readyState() <= MediaPlayer::HaveMetadata) {
+ if (video->webMediaPlayer()->readyState() <= blink::WebMediaPlayer::ReadyStateHaveMetadata) {
acolwell GONE FROM CHROMIUM 2014/06/06 05:51:09 This doesn't seem right. I believe this code shoul
Srirama 2014/06/06 06:41:42 Done.
exceptionState.throwDOMException(InvalidStateError, "The provided element's player has no current data.");
return ScriptPromise();
}
@@ -144,7 +144,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();

Powered by Google App Engine
This is Rietveld 408576698