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

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

Issue 10537121: Adds AudioDevice factory for all audio clients in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes based on review by Chris 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/renderer/media/audio_device_factory.h"
6
7 #include "base/logging.h"
8 #include "content/renderer/media/audio_device.h"
9
10 // static
11 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
12
13 // static
14 media::AudioRendererSink* AudioDeviceFactory::Create() {
15 if (factory_) {
16 return factory_->CreateAudioDevice();
17 }
18 return new AudioDevice();
19 }
20
21 // static
22 void AudioDeviceFactory::RegisterFactory(AudioDeviceFactory* factory) {
23 DCHECK(!factory_) << "Can't register two factories at once.";
24 factory_ = factory;
25 }
26
27 // static
28 void AudioDeviceFactory::UnregisterFactory() {
29 DCHECK(factory_) << "No factory to unregister.";
30 factory_ = NULL;
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698