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

Side by Side Diff: content/renderer/media/audio_device_factory.cc

Issue 1142063003: content/child: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. Created 5 years, 7 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
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/renderer/media/audio_device_factory.h" 5 #include "content/renderer/media/audio_device_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/media/audio_input_message_filter.h" 8 #include "content/renderer/media/audio_input_message_filter.h"
9 #include "content/renderer/media/audio_message_filter.h" 9 #include "content/renderer/media/audio_message_filter.h"
10 #include "media/audio/audio_input_device.h" 10 #include "media/audio/audio_input_device.h"
11 #include "media/audio/audio_output_device.h" 11 #include "media/audio/audio_output_device.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 // static 15 // static
16 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; 16 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
17 17
18 // static 18 // static
19 scoped_refptr<media::AudioOutputDevice> AudioDeviceFactory::NewOutputDevice( 19 scoped_refptr<media::AudioOutputDevice> AudioDeviceFactory::NewOutputDevice(
20 int render_frame_id) { 20 int render_frame_id) {
21 if (factory_) { 21 if (factory_) {
22 media::AudioOutputDevice* const device = 22 media::AudioOutputDevice* const device =
23 factory_->CreateOutputDevice(render_frame_id); 23 factory_->CreateOutputDevice(render_frame_id);
24 if (device) 24 if (device)
25 return device; 25 return device;
26 } 26 }
27 27
28 AudioMessageFilter* const filter = AudioMessageFilter::Get(); 28 AudioMessageFilter* const filter = AudioMessageFilter::Get();
29 return new media::AudioOutputDevice( 29 return new media::AudioOutputDevice(
30 filter->CreateAudioOutputIPC(render_frame_id), filter->io_message_loop()); 30 filter->CreateAudioOutputIPC(render_frame_id), filter->io_task_runner());
31 } 31 }
32 32
33 // static 33 // static
34 scoped_refptr<media::AudioInputDevice> AudioDeviceFactory::NewInputDevice( 34 scoped_refptr<media::AudioInputDevice> AudioDeviceFactory::NewInputDevice(
35 int render_frame_id) { 35 int render_frame_id) {
36 if (factory_) { 36 if (factory_) {
37 media::AudioInputDevice* const device = 37 media::AudioInputDevice* const device =
38 factory_->CreateInputDevice(render_frame_id); 38 factory_->CreateInputDevice(render_frame_id);
39 if (device) 39 if (device)
40 return device; 40 return device;
41 } 41 }
42 42
43 AudioInputMessageFilter* const filter = AudioInputMessageFilter::Get(); 43 AudioInputMessageFilter* const filter = AudioInputMessageFilter::Get();
44 return new media::AudioInputDevice( 44 return new media::AudioInputDevice(
45 filter->CreateAudioInputIPC(render_frame_id), filter->io_message_loop()); 45 filter->CreateAudioInputIPC(render_frame_id), filter->io_task_runner());
46 } 46 }
47 47
48 AudioDeviceFactory::AudioDeviceFactory() { 48 AudioDeviceFactory::AudioDeviceFactory() {
49 DCHECK(!factory_) << "Can't register two factories at once."; 49 DCHECK(!factory_) << "Can't register two factories at once.";
50 factory_ = this; 50 factory_ = this;
51 } 51 }
52 52
53 AudioDeviceFactory::~AudioDeviceFactory() { 53 AudioDeviceFactory::~AudioDeviceFactory() {
54 factory_ = NULL; 54 factory_ = NULL;
55 } 55 }
56 56
57 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/aec_dump_message_filter.cc ('k') | content/renderer/media/audio_input_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698