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.
5 #include "media/audio/audio_manager.h"
7 #include "base/at_exit.h"
8 #include "base/atomicops.h"
10 #include "base/bind_helpers.h"
11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h"
16 AudioManager
* g_last_created
= NULL
;
19 // Forward declaration of the platform specific AudioManager factory function.
20 AudioManager
* CreateAudioManager();
22 AudioManager::AudioManager() {
25 AudioManager::~AudioManager() {
26 CHECK(g_last_created
== NULL
|| g_last_created
== this);
27 g_last_created
= NULL
;
31 AudioManager
* AudioManager::Create() {
32 CHECK(g_last_created
== NULL
);
33 g_last_created
= CreateAudioManager();
34 return g_last_created
;
38 AudioManager
* AudioManager::Get() {
39 return g_last_created
;