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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2689323002: Media: Delete Pause-To-Buffer. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 | « media/blink/webmediaplayer_impl.h ('k') | third_party/WebKit/Source/core/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 119810f9214b8611ebb33a8a391d5fc556132f9b..56d31ceff27ba23134f944c711c3c29a3d340a5c 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -181,7 +181,6 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
ready_state_(WebMediaPlayer::ReadyStateHaveNothing),
highest_ready_state_(WebMediaPlayer::ReadyStateHaveNothing),
preload_(MultibufferDataSource::AUTO),
- buffering_strategy_(MultibufferDataSource::BUFFERING_STRATEGY_NORMAL),
main_task_runner_(frame->loadingTaskRunner()),
media_task_runner_(params.media_task_runner()),
worker_task_runner_(params.worker_task_runner()),
@@ -419,7 +418,6 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type,
url_index_, frame_, media_log_.get(), &buffered_data_source_host_,
base::Bind(&WebMediaPlayerImpl::NotifyDownloading, AsWeakPtr())));
data_source_->SetPreload(preload_);
- data_source_->SetBufferingStrategy(buffering_strategy_);
data_source_->Initialize(
base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, AsWeakPtr()));
}
@@ -638,31 +636,6 @@ void WebMediaPlayerImpl::setPreload(WebMediaPlayer::Preload preload) {
data_source_->SetPreload(preload_);
}
-STATIC_ASSERT_ENUM(WebMediaPlayer::BufferingStrategy::Normal,
- MultibufferDataSource::BUFFERING_STRATEGY_NORMAL);
-STATIC_ASSERT_ENUM(WebMediaPlayer::BufferingStrategy::Aggressive,
- MultibufferDataSource::BUFFERING_STRATEGY_AGGRESSIVE);
-
-void WebMediaPlayerImpl::setBufferingStrategy(
- WebMediaPlayer::BufferingStrategy buffering_strategy) {
- DVLOG(1) << __func__;
- DCHECK(main_task_runner_->BelongsToCurrentThread());
-
-#if defined(OS_ANDROID)
- // We disallow aggressive buffering on Android since it matches the behavior
- // of the platform media player and may have data usage penalties.
- // TODO(dalecurtis, hubbe): We should probably stop using "pause-and-buffer"
- // everywhere. See http://crbug.com/594669 for more details.
- buffering_strategy_ = MultibufferDataSource::BUFFERING_STRATEGY_NORMAL;
-#else
- buffering_strategy_ =
- static_cast<MultibufferDataSource::BufferingStrategy>(buffering_strategy);
-#endif
-
- if (data_source_)
- data_source_->SetBufferingStrategy(buffering_strategy_);
-}
-
bool WebMediaPlayerImpl::hasVideo() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -1153,13 +1126,10 @@ void WebMediaPlayerImpl::OnPipelineSuspended() {
}
#endif
- // If we're not in an aggressive buffering state, tell the data source we have
- // enough data so that it may release the connection.
- if (buffering_strategy_ !=
- MultibufferDataSource::BUFFERING_STRATEGY_AGGRESSIVE) {
- if (data_source_)
- data_source_->OnBufferingHaveEnough(true);
- }
+ // Tell the data source we have enough data so that it may release the
+ // connection.
+ if (data_source_)
+ data_source_->OnBufferingHaveEnough(true);
ReportMemoryUsage();
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | third_party/WebKit/Source/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698