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

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

Issue 291873002: Eliminate MediaPlayer & MediaPlayerClient abstractions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated as per the review comments 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
« no previous file with comments | « Source/core/rendering/RenderVideo.cpp ('k') | Source/modules/mediasource/HTMLVideoElementMediaSource.cpp » ('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 4819ac0f44507fa548d5b885ee2eb584b6117f68..4c88b87d2fd33f81bf57031dc6b16449891095fa 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
@@ -60,8 +60,8 @@ static LayoutSize sizeFor(HTMLImageElement* image)
static IntSize sizeFor(HTMLVideoElement* video)
{
- if (MediaPlayer* player = video->player())
- return player->naturalSize();
+ if (blink::WebMediaPlayer* webMediaPlayer = video->webMediaPlayer())
+ return webMediaPlayer->naturalSize();
return IntSize();
}
@@ -143,7 +143,8 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
exceptionState.throwSecurityError("The source video contains image data from multiple origins.");
return ScriptPromise();
}
- if (!video->player()->didPassCORSAccessCheck() && eventTarget.toDOMWindow()->document()->securityOrigin()->taintsCanvas(video->currentSrc())) {
+ if (!(video->webMediaPlayer() && 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/rendering/RenderVideo.cpp ('k') | Source/modules/mediasource/HTMLVideoElementMediaSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698