OLD | NEW |
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/bind.h" |
| 9 #include "base/bind_helpers.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
10 | 12 |
11 namespace media { | 13 namespace media { |
12 | 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() { |
24 return CreateAudioManager(); | 26 AudioManager* manager = CreateAudioManager(); |
| 27 if (manager) { |
| 28 manager->GetMessageLoop()->PostTask(FROM_HERE, base::Bind( |
| 29 &AudioManager::InitializeOnAudioThread, base::Unretained(manager))); |
| 30 } |
| 31 return manager; |
25 } | 32 } |
26 | 33 |
27 } // namespace media | 34 } // namespace media |
OLD | NEW |