OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "media/audio/audio_manager.h" | 5 #include "media/audio/audio_manager.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 static bool g_destroy_called = false; | 10 static bool g_destroy_called = false; |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // static | 26 // static |
27 AudioManager* AudioManager::GetAudioManager() { | 27 AudioManager* AudioManager::GetAudioManager() { |
28 if (!g_audio_manager && !g_destroy_called) { | 28 if (!g_audio_manager && !g_destroy_called) { |
29 g_audio_manager = CreateAudioManager(); | 29 g_audio_manager = CreateAudioManager(); |
30 g_audio_manager->Init(); | 30 g_audio_manager->Init(); |
31 base::AtExitManager::RegisterCallback(&AudioManager::Destroy, NULL); | 31 base::AtExitManager::RegisterCallback(&AudioManager::Destroy, NULL); |
32 } | 32 } |
33 return g_audio_manager; | 33 return g_audio_manager; |
34 } | 34 } |
| 35 |
| 36 // static |
| 37 bool AudioManager::SingletonExists() { |
| 38 return g_audio_manager != NULL; |
| 39 } |
| 40 |
| 41 // static |
| 42 void AudioManager::Resurrect() { |
| 43 g_destroy_called = false; |
| 44 } |
OLD | NEW |