diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-01 15:42:38 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-01 15:42:38 +0000 |
commit | 21b3d203094067a4c5f55e627ceb6bd40749fd02 (patch) | |
tree | 641cb4a9bffa54b67ae7bda4cfc51c92859b8d7a /webkit/glue | |
parent | 51e40cb135078ed5a6b06600e741ba0572a17dd0 (diff) | |
download | chromium_src-21b3d203094067a4c5f55e627ceb6bd40749fd02.zip chromium_src-21b3d203094067a4c5f55e627ceb6bd40749fd02.tar.gz chromium_src-21b3d203094067a4c5f55e627ceb6bd40749fd02.tar.bz2 |
Fix deadlock during player shutdown when a Seek() and an Abort() are racing.
BUG=74031
TEST=trybots, repro site from bug report, and a layouttest which I probably won't be able to submit since it requires a large (14MB) video file to repro, and webkit's bugzilla assplodes on patches over 10MB.
Review URL: http://codereview.chromium.org/6690065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/media/buffered_data_source.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/webkit/glue/media/buffered_data_source.cc b/webkit/glue/media/buffered_data_source.cc index 2622255..d0d42aa 100644 --- a/webkit/glue/media/buffered_data_source.cc +++ b/webkit/glue/media/buffered_data_source.cc @@ -200,15 +200,6 @@ bool BufferedDataSource::HasSingleOrigin() { void BufferedDataSource::Abort() { DCHECK(MessageLoop::current() == render_loop_); - { - base::AutoLock auto_lock(lock_); - - // If we are told to abort, immediately return from any pending read - // with an error. - if (read_callback_.get()) - DoneRead_Locked(net::ERR_FAILED); - } - CleanupTask(); frame_ = NULL; } @@ -282,7 +273,13 @@ void BufferedDataSource::CleanupTask() { if (stopped_on_render_loop_) return; - read_callback_.reset(); + // Signal that stop task has finished execution. + // NOTE: it's vital that this be set under lock, as that's how Read() tests + // before registering a new |read_callback_| (which is cleared below). + stopped_on_render_loop_ = true; + + if (read_callback_.get()) + DoneRead_Locked(net::ERR_FAILED); } // Stop the watch dog. @@ -298,9 +295,6 @@ void BufferedDataSource::CleanupTask() { read_buffer_ = 0; read_submitted_time_ = base::Time(); read_attempts_ = 0; - - // Signal that stop task has finished execution. - stopped_on_render_loop_ = true; } void BufferedDataSource::RestartLoadingTask() { |