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

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

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: 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 #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
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 }
OLDNEW
« content/renderer/media/webrtc_audio_device_unittest.cc ('K') | « media/audio/audio_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698