| 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 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 protected: | 113 protected: |
| 114 virtual ~AudioManager() {} | 114 virtual ~AudioManager() {} |
| 115 | 115 |
| 116 // Called from GetAudioManager() to initialiaze the instance. | 116 // Called from GetAudioManager() to initialiaze the instance. |
| 117 virtual void Init() = 0; | 117 virtual void Init() = 0; |
| 118 | 118 |
| 119 // Called by Destroy() to cleanup the instance before destruction. | 119 // Called by Destroy() to cleanup the instance before destruction. |
| 120 virtual void Cleanup() = 0; | 120 virtual void Cleanup() = 0; |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 // Allow unit tests to delete and recreate the singleton. |
| 124 friend class AutoAudioManagerCleanup; |
| 123 static void Destroy(void*); | 125 static void Destroy(void*); |
| 126 static bool SingletonExists(); |
| 127 static void Resurrect(); |
| 124 | 128 |
| 125 // Called by GetAudioManager() to create platform-specific audio manager. | 129 // Called by GetAudioManager() to create platform-specific audio manager. |
| 126 static AudioManager* CreateAudioManager(); | 130 static AudioManager* CreateAudioManager(); |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 DISABLE_RUNNABLE_METHOD_REFCOUNT(AudioManager); | 133 DISABLE_RUNNABLE_METHOD_REFCOUNT(AudioManager); |
| 130 | 134 |
| 131 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 135 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |