Chromium Code Reviews| Index: webkit/media/buffered_data_source.cc |
| diff --git a/webkit/media/buffered_data_source.cc b/webkit/media/buffered_data_source.cc |
| index 17431022b85fbffac88150591b31d39b7b592638..6bea201f62e8bf55c1cd40eca625a144eb9935ee 100644 |
| --- a/webkit/media/buffered_data_source.cc |
| +++ b/webkit/media/buffered_data_source.cc |
| @@ -240,27 +240,6 @@ void BufferedDataSource::CleanupTask() { |
| read_buffer_ = 0; |
| } |
| -void BufferedDataSource::RestartLoadingTask() { |
| - DCHECK(MessageLoop::current() == render_loop_); |
| - if (stopped_on_render_loop_) |
| - return; |
| - |
| - { |
| - // If there's no outstanding read then return early. |
| - base::AutoLock auto_lock(lock_); |
| - if (read_cb_.is_null()) |
| - return; |
| - } |
| - |
| - // Start reading from where we last left off until the end of the resource. |
| - loader_.reset(CreateResourceLoader(last_read_start_, kPositionNotSpecified)); |
| - loader_->Start( |
| - base::Bind(&BufferedDataSource::PartialReadStartCallback, this), |
| - base::Bind(&BufferedDataSource::LoadingCallback, this), |
| - base::Bind(&BufferedDataSource::ProgressCallback, this), |
| - frame_); |
| -} |
| - |
| void BufferedDataSource::SetPlaybackRateTask(float playback_rate) { |
| DCHECK(MessageLoop::current() == render_loop_); |
| DCHECK(loader_.get()); |
| @@ -433,8 +412,16 @@ void BufferedDataSource::ReadCallback( |
| if (status == BufferedResourceLoader::kCacheMiss && |
| cache_miss_retries_left_ > 0) { |
| cache_miss_retries_left_--; |
| - render_loop_->PostTask(FROM_HERE, |
| - base::Bind(&BufferedDataSource::RestartLoadingTask, this)); |
| + |
| + // Recreate a loader starting from where we last left off until the |
|
Ami GONE FROM CHROMIUM
2012/07/10 02:48:25
Why is it no longer necessary to test stopped_on_r
scherkus (not reviewing)
2012/07/10 03:15:16
Previously the only way that could happen is if Cl
|
| + // end of the resource. |
| + loader_.reset(CreateResourceLoader( |
| + last_read_start_, kPositionNotSpecified)); |
| + loader_->Start( |
| + base::Bind(&BufferedDataSource::PartialReadStartCallback, this), |
| + base::Bind(&BufferedDataSource::LoadingCallback, this), |
| + base::Bind(&BufferedDataSource::ProgressCallback, this), |
| + frame_); |
| return; |
| } |