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

Unified Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 443393002: Stop using WebMediaPlayerClient::preload() and volume() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « content/renderer/media/webmediaplayer_impl.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webmediaplayer_impl.cc
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index 09633bde08c4e972a6b4742d67ba4a5bf90ac9bd..35af6cd3bb58940ad95b712c9b401bb3e45ee2e8 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -171,6 +171,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
: frame_(frame),
network_state_(WebMediaPlayer::NetworkStateEmpty),
ready_state_(WebMediaPlayer::ReadyStateHaveNothing),
+ preload_(AUTO),
main_loop_(base::MessageLoopProxy::current()),
media_loop_(
RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy()),
@@ -289,10 +290,6 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type,
load_type_ = load_type;
- // Handle any volume/preload changes that occurred before load().
- setVolume(client_->volume());
- setPreload(client_->preload());
-
SetNetworkState(WebMediaPlayer::NetworkStateLoading);
SetReadyState(WebMediaPlayer::ReadyStateHaveNothing);
media_log_->AddEvent(media_log_->CreateLoadEvent(url.spec()));
@@ -315,6 +312,7 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type,
base::Bind(&WebMediaPlayerImpl::NotifyDownloading, AsWeakPtr())));
data_source_->Initialize(
base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, AsWeakPtr()));
+ data_source_->SetPreload(preload_);
}
void WebMediaPlayerImpl::play() {
@@ -432,8 +430,9 @@ void WebMediaPlayerImpl::setPreload(WebMediaPlayer::Preload preload) {
DVLOG(1) << __FUNCTION__ << "(" << preload << ")";
DCHECK(main_loop_->BelongsToCurrentThread());
+ preload_ = static_cast<content::Preload>(preload);
if (data_source_)
- data_source_->SetPreload(static_cast<content::Preload>(preload));
+ data_source_->SetPreload(preload_);
}
bool WebMediaPlayerImpl::hasVideo() const {
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698