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

Unified Diff: webkit/media/buffered_data_source.cc

Issue 10700125: Fold RestartLoadingTask() into ReadCallback() as the method is called on the render thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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_resource_loader.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 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;
}
« no previous file with comments | « webkit/media/buffered_data_source.h ('k') | webkit/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698