diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 09:16:58 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 09:16:58 +0000 |
commit | 8f5fc718853a128dc2f70ec4e55db4044af64bcc (patch) | |
tree | 4f283d47012fd9594433990e89ad7f4fff3f0bcd /content/test/webrtc_audio_device_test.cc | |
parent | ae4e03118d9a8792b907c923adf6516495f20536 (diff) | |
download | chromium_src-8f5fc718853a128dc2f70ec4e55db4044af64bcc.zip chromium_src-8f5fc718853a128dc2f70ec4e55db4044af64bcc.tar.gz chromium_src-8f5fc718853a128dc2f70ec4e55db4044af64bcc.tar.bz2 |
Add thread safety to AudioManagerBase to protect access to the audio thread member variable.
This is is a tentative fix for an issue where the AudioManager can crash while tearing down
the audio thread. I suspect that this happens because more than one cleanup attempts were
made since the class wasn't thread safe. I'm also changing direct access to the thread's
MessageLoop* to use MessageLoopProxy based on the same theory.
BUG=110051
TEST=Run media tests.
Review URL: https://chromiumcodereview.appspot.com/9255017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/webrtc_audio_device_test.cc')
-rw-r--r-- | content/test/webrtc_audio_device_test.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index d4ea8b7..94c155b 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -277,7 +277,8 @@ bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { // Posts a final task to the IO message loop and waits for completion. void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { - WaitForMessageLoopCompletion(ChildProcess::current()->io_message_loop()); + WaitForMessageLoopCompletion( + ChildProcess::current()->io_message_loop()->message_loop_proxy()); } void WebRTCAudioDeviceTest::WaitForAudioManagerCompletion() { @@ -285,7 +286,8 @@ void WebRTCAudioDeviceTest::WaitForAudioManagerCompletion() { WaitForMessageLoopCompletion(audio_manager_->GetMessageLoop()); } -void WebRTCAudioDeviceTest::WaitForMessageLoopCompletion(MessageLoop* loop) { +void WebRTCAudioDeviceTest::WaitForMessageLoopCompletion( + base::MessageLoopProxy* loop) { base::WaitableEvent* event = new base::WaitableEvent(false, false); loop->PostTask(FROM_HERE, base::Bind(&base::WaitableEvent::Signal, base::Unretained(event))); |