diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-06 19:11:06 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-06 19:11:06 +0000 |
commit | 348a36066deeeeb8d350a712f6005a9e6754bacc (patch) | |
tree | cae548f44ed4cc57b2a225f92d4e7540321764e9 /webkit | |
parent | f523b68eea59db2e5f9f9df34598d9203ff8786f (diff) | |
download | chromium_src-348a36066deeeeb8d350a712f6005a9e6754bacc.zip chromium_src-348a36066deeeeb8d350a712f6005a9e6754bacc.tar.gz chromium_src-348a36066deeeeb8d350a712f6005a9e6754bacc.tar.bz2 |
Use stopped_on_render_loop_ to prevent further work from executing in BufferedDataSource.
Previously we were using it as a DCHECK but we would fail gracefully. Now that stopped_on_render_loop_ is set via Abort() (i.e., catastrophic failure), we need to use it as a singal to make sure all work on the render loop does indeed stop.
BUG=16751
TEST=http/tests/media should stop crashing
Review URL: http://codereview.chromium.org/5603004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/media/buffered_data_source.cc | 20 | ||||
-rw-r--r-- | webkit/glue/media/buffered_data_source.h | 2 |
2 files changed, 5 insertions, 17 deletions
diff --git a/webkit/glue/media/buffered_data_source.cc b/webkit/glue/media/buffered_data_source.cc index c864767..2091cc9 100644 --- a/webkit/glue/media/buffered_data_source.cc +++ b/webkit/glue/media/buffered_data_source.cc @@ -671,7 +671,8 @@ void BufferedDataSource::Abort() { void BufferedDataSource::InitializeTask() { DCHECK(MessageLoop::current() == render_loop_); DCHECK(!loader_.get()); - DCHECK(!stopped_on_render_loop_); + if (stopped_on_render_loop_) + return; // Kick starts the watch dog task that will handle connection timeout. // We run the watch dog 2 times faster the actual timeout so as to catch @@ -706,11 +707,6 @@ void BufferedDataSource::ReadTask( int64 position, int read_size, uint8* buffer, media::DataSource::ReadCallback* read_callback) { DCHECK(MessageLoop::current() == render_loop_); - - // If CleanupTask() was executed we should return immediately. We check this - // variable to prevent doing any actual work after clean up was done. We do - // not check |stop_signal_received_| because anything use of it has to be - // within |lock_| which is not desirable. if (stopped_on_render_loop_) return; @@ -731,8 +727,6 @@ void BufferedDataSource::ReadTask( void BufferedDataSource::CleanupTask() { DCHECK(MessageLoop::current() == render_loop_); - - // If we have already stopped, do nothing. if (stopped_on_render_loop_) return; @@ -757,13 +751,6 @@ void BufferedDataSource::CleanupTask() { void BufferedDataSource::RestartLoadingTask() { DCHECK(MessageLoop::current() == render_loop_); - - // This variable is set in CleanupTask(). We check this and do an early - // return. The sequence of actions which enable this conditions is: - // 1. Stop() is called from the pipeline. - // 2. ReadCallback() is called from the resource loader. - // 3. CleanupTask() is executed. - // 4. RestartLoadingTask() is executed. if (stopped_on_render_loop_) return; @@ -780,7 +767,8 @@ void BufferedDataSource::RestartLoadingTask() { void BufferedDataSource::WatchDogTask() { DCHECK(MessageLoop::current() == render_loop_); - DCHECK(!stopped_on_render_loop_); + if (stopped_on_render_loop_) + return; // We only care if there is an active read request. if (!read_callback_.get()) diff --git a/webkit/glue/media/buffered_data_source.h b/webkit/glue/media/buffered_data_source.h index 7218390..8f00460 100644 --- a/webkit/glue/media/buffered_data_source.h +++ b/webkit/glue/media/buffered_data_source.h @@ -384,7 +384,7 @@ class BufferedDataSource : public WebDataSource { bool stop_signal_received_; // This variable is set by CleanupTask() that indicates this object is stopped - // on the render thread. + // on the render thread and work should no longer progress. bool stopped_on_render_loop_; // This variable is true when we are in a paused state and false when we |