OLD | NEW |
(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 namespace content { |
| 11 |
| 12 // static |
| 13 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; |
| 14 |
| 15 // static |
| 16 media::AudioRendererSink* AudioDeviceFactory::Create() { |
| 17 if (factory_) { |
| 18 return factory_->CreateAudioDevice(); |
| 19 } |
| 20 return new AudioDevice(); |
| 21 } |
| 22 |
| 23 AudioDeviceFactory::AudioDeviceFactory() { |
| 24 DCHECK(!factory_) << "Can't register two factories at once."; |
| 25 factory_ = this; |
| 26 } |
| 27 |
| 28 AudioDeviceFactory::~AudioDeviceFactory() { |
| 29 factory_ = NULL; |
| 30 } |
| 31 |
| 32 } // namespace content |
OLD | NEW |