diff options
author | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 15:02:12 +0000 |
---|---|---|
committer | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 15:02:12 +0000 |
commit | 8bc74b44f18a1aad65c56d827b5f8f14c7e123b2 (patch) | |
tree | a681d9990b7cad9885af2f53c607aef045940101 /content/browser/renderer_host/media/audio_input_renderer_host.cc | |
parent | f0f67736354e2e0162811a2308d7f2853ec81eb9 (diff) | |
download | chromium_src-8bc74b44f18a1aad65c56d827b5f8f14c7e123b2.zip chromium_src-8bc74b44f18a1aad65c56d827b5f8f14c7e123b2.tar.gz chromium_src-8bc74b44f18a1aad65c56d827b5f8f14c7e123b2.tar.bz2 |
Removes the AudioInputControllerThread from AudioInputController.
Now runs on the audio-manager thread instead.
BUG=none
TEST=media_unitest and content_unittests
Review URL: https://chromiumcodereview.appspot.com/9307049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/media/audio_input_renderer_host.cc')
-rw-r--r-- | content/browser/renderer_host/media/audio_input_renderer_host.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc index a600e0f..6722edc 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc @@ -381,17 +381,19 @@ void AudioInputRendererHost::StopAndDeleteDevice(int session_id) { } void AudioInputRendererHost::CloseAndDeleteStream(AudioEntry* entry) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + if (!entry->pending_close) { + entry->controller->Close(base::Bind(&AudioInputRendererHost::OnStreamClosed, + this , entry)); entry->pending_close = true; - // TODO(henrika): AudioRendererHost uses an alternative method - // to close down the AudioController. Try to refactor and merge - // the implementations. - entry->controller->Close(); - OnStreamClosed(entry); } } void AudioInputRendererHost::OnStreamClosed(AudioEntry* entry) { + // We should be on the the audio-manager thread now. + DCHECK(entry->controller->message_loop()->BelongsToCurrentThread()); + // Delete the entry after we've closed the stream. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, |