diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 17:58:16 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 17:58:16 +0000 |
commit | c499d08ff59eae8bfae79ed3ea2d21178790a5c7 (patch) | |
tree | 26f83da51be78fcba29349c3b0edda38eba8afef /media/audio/audio_output_controller.h | |
parent | 1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9 (diff) | |
download | chromium_src-c499d08ff59eae8bfae79ed3ea2d21178790a5c7.zip chromium_src-c499d08ff59eae8bfae79ed3ea2d21178790a5c7.tar.gz chromium_src-c499d08ff59eae8bfae79ed3ea2d21178790a5c7.tar.bz2 |
Fixed crash in AudioOutputController.
AudioOutputController must not call EventHandler after it has been
closed. Changing it so that lock_ is always locked whenever we call
handler_ to ensure that state_ != kClosed.
BUG=54939
TEST=unittests
Review URL: http://codereview.chromium.org/3308025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_output_controller.h')
-rw-r--r-- | media/audio/audio_output_controller.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h index c260e58..e9ed321 100644 --- a/media/audio/audio_output_controller.h +++ b/media/audio/audio_output_controller.h @@ -175,6 +175,7 @@ class AudioOutputController // Helper method to submit a OnMoreData() call to the event handler. void SubmitOnMoreData_Locked(); + // |handler_| may be called only if |state_| is not kClosed. EventHandler* handler_; AudioOutputStream* stream_; @@ -188,6 +189,9 @@ class AudioOutputController uint32 hardware_pending_bytes_; base::Time last_callback_time_; + + // The |lock_| must be acquired whenever we access |state_| or call + // |handler_|. Lock lock_; // PushSource role is to buffer and it's only used in regular latency mode. |