OLD | NEW |
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/common/child_process.h" | 8 #include "content/common/child_process.h" |
9 #include "content/renderer/media/audio_device.h" | 9 #include "content/renderer/media/audio_device.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // static | 13 // static |
14 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; | 14 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; |
15 | 15 |
16 // static | 16 // static |
17 media::AudioRendererSink* AudioDeviceFactory::Create() { | 17 media::AudioRendererSink* AudioDeviceFactory::Create(RenderView* render_view) { |
18 if (factory_) { | 18 if (factory_) { |
19 return factory_->CreateAudioDevice(); | 19 return factory_->CreateAudioDevice(); |
20 } | 20 } |
21 return new AudioDevice( | 21 return new AudioDevice( |
| 22 render_view, |
22 ChildProcess::current()->io_message_loop()->message_loop_proxy()); | 23 ChildProcess::current()->io_message_loop()->message_loop_proxy()); |
23 } | 24 } |
24 | 25 |
25 AudioDeviceFactory::AudioDeviceFactory() { | 26 AudioDeviceFactory::AudioDeviceFactory() { |
26 DCHECK(!factory_) << "Can't register two factories at once."; | 27 DCHECK(!factory_) << "Can't register two factories at once."; |
27 factory_ = this; | 28 factory_ = this; |
28 } | 29 } |
29 | 30 |
30 AudioDeviceFactory::~AudioDeviceFactory() { | 31 AudioDeviceFactory::~AudioDeviceFactory() { |
31 factory_ = NULL; | 32 factory_ = NULL; |
32 } | 33 } |
33 | 34 |
34 } // namespace content | 35 } // namespace content |
OLD | NEW |