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

Side by Side Diff: media/audio/audio_manager.h

Issue 8558022: Expose a way for unit tests to terminate the AudioManager singleton to avoid conflicts between te... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: address comments from henrika Created 9 years, 1 month 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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698