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

Unified Diff: webkit/media/buffered_data_source.cc

Issue 10535101: Replace Pipeline::SetNetworkActivity() with BufferedDataSource -> WebMediaPlayerImpl callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | « webkit/media/buffered_data_source.h ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/buffered_data_source.cc
diff --git a/webkit/media/buffered_data_source.cc b/webkit/media/buffered_data_source.cc
index 3193a1ca523cda4600e65376f7687368b4bf1808..fd34ea3808a05c460685feb301592f5126323f1a 100644
--- a/webkit/media/buffered_data_source.cc
+++ b/webkit/media/buffered_data_source.cc
@@ -25,13 +25,13 @@ static const int kNumCacheMissRetries = 3;
BufferedDataSource::BufferedDataSource(
MessageLoop* render_loop,
WebFrame* frame,
- media::MediaLog* media_log)
+ media::MediaLog* media_log,
+ const DownloadingCB& downloading_cb)
: total_bytes_(kPositionNotSpecified),
buffered_bytes_(0),
streaming_(false),
frame_(frame),
loader_(NULL),
- is_downloading_data_(false),
read_size_(0),
read_buffer_(NULL),
last_read_start_(0),
@@ -45,7 +45,9 @@ BufferedDataSource::BufferedDataSource(
cache_miss_retries_left_(kNumCacheMissRetries),
bitrate_(0),
playback_rate_(0.0),
- media_log_(media_log) {
+ media_log_(media_log),
+ downloading_cb_(downloading_cb) {
+ DCHECK(!downloading_cb_.is_null());
}
BufferedDataSource::~BufferedDataSource() {}
@@ -549,7 +551,8 @@ void BufferedDataSource::NetworkEventCallback() {
if (!url_.SchemeIs(kHttpScheme) && !url_.SchemeIs(kHttpsScheme))
return;
- bool is_downloading_data = loader_->is_downloading_data();
+ downloading_cb_.Run(loader_->is_downloading_data());
+
int64 current_buffered_position = loader_->GetBufferedPosition();
// If we get an unspecified value, return immediately.
@@ -568,12 +571,6 @@ void BufferedDataSource::NetworkEventCallback() {
if (stop_signal_received_)
return;
- if (is_downloading_data != is_downloading_data_) {
- is_downloading_data_ = is_downloading_data;
- if (host())
- host()->SetNetworkActivity(is_downloading_data);
- }
-
int64 start = loader_->first_byte_position();
if (host() && current_buffered_position > start)
host()->AddBufferedByteRange(start, current_buffered_position);
« no previous file with comments | « webkit/media/buffered_data_source.h ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698