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

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

Issue 10704154: Small refactor to media architecture in order to allow end-to-end tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
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 namespace media { 11 namespace media {
12 12
13 AudioManager* AudioManager::audio_manager_for_tests_ = NULL;
14
13 // Forward declaration of the platform specific AudioManager factory function. 15 // Forward declaration of the platform specific AudioManager factory function.
14 AudioManager* CreateAudioManager(); 16 AudioManager* CreateAudioManager();
15 17
16 AudioManager::AudioManager() { 18 AudioManager::AudioManager() {
17 } 19 }
18 20
19 AudioManager::~AudioManager() { 21 AudioManager::~AudioManager() {
20 } 22 }
21 23
22 // static 24 // static
23 AudioManager* AudioManager::Create() { 25 AudioManager* AudioManager::Create() {
26 if (audio_manager_for_tests_)
27 return audio_manager_for_tests_;
24 AudioManager* ret = CreateAudioManager(); 28 AudioManager* ret = CreateAudioManager();
25 ret->Init(); 29 ret->Init();
26 return ret; 30 return ret;
27 } 31 }
28 32
33 // static
34 void AudioManager::set_audio_manager_for_tests(AudioManager* audio_manager) {
35 audio_manager_for_tests_ = audio_manager;
36 }
37
29 } // namespace media 38 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698