| Index: webkit/media/buffered_data_source.cc
|
| ===================================================================
|
| --- webkit/media/buffered_data_source.cc (revision 118589)
|
| +++ webkit/media/buffered_data_source.cc (working copy)
|
| @@ -552,10 +552,11 @@
|
| // before. Update the total size so Read()s past the end of the file will
|
| // fail like they would if we had known the file size at the beginning.
|
| total_bytes_ = loader_->instance_size();
|
| - if (total_bytes_ != kPositionNotSpecified)
|
| - buffered_bytes_ = total_bytes_;
|
|
|
| - UpdateHostState_Locked();
|
| + if (host() && total_bytes_ != kPositionNotSpecified) {
|
| + host()->SetTotalBytes(total_bytes_);
|
| + host()->SetBufferedBytes(total_bytes_);
|
| + }
|
| }
|
| DoneRead_Locked(error);
|
| }
|
| @@ -588,10 +589,15 @@
|
| if (stop_signal_received_)
|
| return;
|
|
|
| - is_downloading_data_ = is_downloading_data;
|
| + if (is_downloading_data != is_downloading_data_) {
|
| + is_downloading_data_ = is_downloading_data;
|
| + if (host())
|
| + host()->SetNetworkActivity(is_downloading_data);
|
| + }
|
| +
|
| buffered_bytes_ = buffered_position + 1;
|
| -
|
| - UpdateHostState_Locked();
|
| + if (host())
|
| + host()->SetBufferedBytes(buffered_bytes_);
|
| }
|
|
|
| void BufferedDataSource::UpdateHostState_Locked() {
|
| @@ -603,7 +609,6 @@
|
|
|
| if (total_bytes_ != kPositionNotSpecified)
|
| host()->SetTotalBytes(total_bytes_);
|
| - host()->SetNetworkActivity(is_downloading_data_);
|
| host()->SetBufferedBytes(buffered_bytes_);
|
| }
|
|
|
|
|