Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: content/test/webrtc_audio_device_test.cc

Issue 14273018: Use the browser UI thread for audio on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/test/webrtc_audio_device_test.h" 5 #include "content/test/webrtc_audio_device_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // whole thing to be torn down before we finally uninitialize the io thread. 173 // whole thing to be torn down before we finally uninitialize the io thread.
174 WaitForAudioManagerCompletion(); 174 WaitForAudioManagerCompletion();
175 175
176 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE, 176 ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
177 base::Bind(&WebRTCAudioDeviceTest::UninitializeIOThread, 177 base::Bind(&WebRTCAudioDeviceTest::UninitializeIOThread,
178 base::Unretained((this)))); 178 base::Unretained((this))));
179 WaitForIOThreadCompletion(); 179 WaitForIOThreadCompletion();
180 mock_process_.reset(); 180 mock_process_.reset();
181 media_stream_manager_.reset(); 181 media_stream_manager_.reset();
182 mirroring_manager_.reset(); 182 mirroring_manager_.reset();
183 audio_manager_.reset();
184 RendererWebKitPlatformSupportImpl::SetSandboxEnabledForTesting( 183 RendererWebKitPlatformSupportImpl::SetSandboxEnabledForTesting(
185 sandbox_was_enabled_); 184 sandbox_was_enabled_);
186 } 185 }
187 186
188 bool WebRTCAudioDeviceTest::Send(IPC::Message* message) { 187 bool WebRTCAudioDeviceTest::Send(IPC::Message* message) {
189 return channel_->Send(message); 188 return channel_->Send(message);
190 } 189 }
191 190
192 void WebRTCAudioDeviceTest::SetAudioHardwareConfig( 191 void WebRTCAudioDeviceTest::SetAudioHardwareConfig(
193 media::AudioHardwareConfig* hardware_config) { 192 media::AudioHardwareConfig* hardware_config) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 224 }
226 225
227 void WebRTCAudioDeviceTest::UninitializeIOThread() { 226 void WebRTCAudioDeviceTest::UninitializeIOThread() {
228 resource_context_.reset(); 227 resource_context_.reset();
229 228
230 test_request_context_.reset(); 229 test_request_context_.reset();
231 230
232 #if defined(OS_WIN) 231 #if defined(OS_WIN)
233 initialize_com_.reset(); 232 initialize_com_.reset();
234 #endif 233 #endif
234
235 audio_manager_.reset();
235 } 236 }
236 237
237 void WebRTCAudioDeviceTest::CreateChannel(const char* name) { 238 void WebRTCAudioDeviceTest::CreateChannel(const char* name) {
238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
239 240
240 static const int kRenderProcessId = 1; 241 static const int kRenderProcessId = 1;
241 audio_render_host_ = new AudioRendererHost( 242 audio_render_host_ = new AudioRendererHost(
242 kRenderProcessId, audio_manager_.get(), mirroring_manager_.get(), 243 kRenderProcessId, audio_manager_.get(), mirroring_manager_.get(),
243 media_internals_.get(), media_stream_manager_.get()); 244 media_internals_.get(), media_stream_manager_.get());
244 audio_render_host_->OnChannelConnected(base::GetCurrentProcId()); 245 audio_render_host_->OnChannelConnected(base::GetCurrentProcId());
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 358 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
358 return network_->ReceivedRTPPacket(channel, data, len); 359 return network_->ReceivedRTPPacket(channel, data, len);
359 } 360 }
360 361
361 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 362 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
362 int len) { 363 int len) {
363 return network_->ReceivedRTCPPacket(channel, data, len); 364 return network_->ReceivedRTCPPacket(channel, data, len);
364 } 365 }
365 366
366 } // namespace content 367 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_input_renderer_host.cc ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698