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

Unified Diff: media/audio/mac/audio_manager_mac.cc

Issue 3185022: Share one thread between all AudioOutputControllers instead of creating one per stream. (Closed)
Patch Set: - Created 10 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/mac/audio_manager_mac.h ('k') | media/audio/mac/audio_output_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_manager_mac.cc
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index 312ecbb0046460605f6805b018f46f1226647f9a..528fd6e054c0f51b2d2cb023851e1d8f50f94931 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -4,7 +4,6 @@
#include <CoreAudio/AudioHardware.h>
-#include "base/at_exit.h"
#include "media/audio/fake_audio_input_stream.h"
#include "media/audio/fake_audio_output_stream.h"
#include "media/audio/mac/audio_manager_mac.h"
@@ -75,22 +74,7 @@ void AudioManagerMac::ReleaseOutputStream(
delete stream;
}
-namespace {
-
-AudioManagerMac* g_audio_manager = NULL;
-
-} // namespace.
-
-void DestroyAudioManagerMac(void* param) {
- delete g_audio_manager;
- g_audio_manager = NULL;
-}
-
-// By convention, the AudioManager is not thread safe.
-AudioManager* AudioManager::GetAudioManager() {
- if (!g_audio_manager) {
- g_audio_manager = new AudioManagerMac();
- base::AtExitManager::RegisterCallback(&DestroyAudioManagerMac, NULL);
- }
- return g_audio_manager;
+// static
+AudioManager* AudioManager::CreateAudioManager() {
+ return new AudioManagerMac();
}
« no previous file with comments | « media/audio/mac/audio_manager_mac.h ('k') | media/audio/mac/audio_output_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698