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

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

Issue 9433006: Remove GetAudioManager and GetMediaStreamManager from ResourceContext. The reason is the content mo… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/webrtc_audio_device_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 10
11 // Used only to make sure we never create more than one instance.
12 static AudioManager* g_audio_manager = NULL;
13
14 // Forward declaration of the platform specific AudioManager factory function. 11 // Forward declaration of the platform specific AudioManager factory function.
15 AudioManager* CreateAudioManager(); 12 AudioManager* CreateAudioManager();
16 13
17 AudioManager::AudioManager() { 14 AudioManager::AudioManager() {
18 CHECK(g_audio_manager == NULL);
19 g_audio_manager = this;
20 } 15 }
21 16
22 AudioManager::~AudioManager() { 17 AudioManager::~AudioManager() {
23 CHECK(g_audio_manager == this);
24 g_audio_manager = NULL;
25 } 18 }
26 19
27 // static 20 // static
28 AudioManager* AudioManager::Create() { 21 AudioManager* AudioManager::Create() {
29 AudioManager* ret = CreateAudioManager(); 22 AudioManager* ret = CreateAudioManager();
30 DCHECK(ret == g_audio_manager);
31 ret->Init(); 23 ret->Init();
32 return ret; 24 return ret;
33 } 25 }
OLDNEW
« no previous file with comments | « content/test/webrtc_audio_device_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698