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

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

Issue 10790121: First step towards moving AudioDevice from content/ to media/audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary #include Created 8 years, 5 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/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 #include "content/renderer/media/audio_message_filter.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 // static 14 // static
14 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; 15 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
15 16
16 // static 17 // static
17 media::AudioRendererSink* AudioDeviceFactory::Create() { 18 media::AudioRendererSink* AudioDeviceFactory::Create() {
18 if (factory_) { 19 if (factory_) {
19 return factory_->CreateAudioDevice(); 20 return factory_->CreateAudioDevice();
20 } 21 }
21 return new AudioDevice( 22 return new AudioDevice(
23 AudioMessageFilter::Get(),
22 ChildProcess::current()->io_message_loop()->message_loop_proxy()); 24 ChildProcess::current()->io_message_loop()->message_loop_proxy());
23 } 25 }
24 26
25 AudioDeviceFactory::AudioDeviceFactory() { 27 AudioDeviceFactory::AudioDeviceFactory() {
26 DCHECK(!factory_) << "Can't register two factories at once."; 28 DCHECK(!factory_) << "Can't register two factories at once.";
27 factory_ = this; 29 factory_ = this;
28 } 30 }
29 31
30 AudioDeviceFactory::~AudioDeviceFactory() { 32 AudioDeviceFactory::~AudioDeviceFactory() {
31 factory_ = NULL; 33 factory_ = NULL;
32 } 34 }
33 35
34 } // namespace content 36 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698