OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/media/capture/audio_mirroring_manager.h" | 5 #include "content/browser/media/capture/audio_mirroring_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/lazy_instance.h" | |
12 | 11 |
13 namespace content { | 12 namespace content { |
14 | 13 |
15 namespace { | |
16 | |
17 base::LazyInstance<AudioMirroringManager>::Leaky g_audio_mirroring_manager = | |
18 LAZY_INSTANCE_INITIALIZER; | |
19 | |
20 } // namespace | |
21 | |
22 // static | 14 // static |
23 AudioMirroringManager* AudioMirroringManager::GetInstance() { | 15 AudioMirroringManager* AudioMirroringManager::GetInstance() { |
24 return g_audio_mirroring_manager.Pointer(); | 16 static AudioMirroringManager* manager = new AudioMirroringManager(); |
miu
2017/01/31 22:41:50
Dumb question: The memory bots are aware that stat
| |
17 return manager; | |
25 } | 18 } |
26 | 19 |
27 AudioMirroringManager::AudioMirroringManager() { | 20 AudioMirroringManager::AudioMirroringManager() { |
28 // Only *after* construction, check that AudioMirroringManager is being | 21 // Only *after* construction, check that AudioMirroringManager is being |
29 // invoked on the same single thread. | 22 // invoked on the same single thread. |
30 thread_checker_.DetachFromThread(); | 23 thread_checker_.DetachFromThread(); |
31 } | 24 } |
32 | 25 |
33 AudioMirroringManager::~AudioMirroringManager() {} | 26 AudioMirroringManager::~AudioMirroringManager() {} |
34 | 27 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 : source_render_frame(source_frame), | 260 : source_render_frame(source_frame), |
268 diverter(stream_diverter), | 261 diverter(stream_diverter), |
269 destination(NULL) {} | 262 destination(NULL) {} |
270 | 263 |
271 AudioMirroringManager::StreamRoutingState::StreamRoutingState( | 264 AudioMirroringManager::StreamRoutingState::StreamRoutingState( |
272 const StreamRoutingState& other) = default; | 265 const StreamRoutingState& other) = default; |
273 | 266 |
274 AudioMirroringManager::StreamRoutingState::~StreamRoutingState() {} | 267 AudioMirroringManager::StreamRoutingState::~StreamRoutingState() {} |
275 | 268 |
276 } // namespace content | 269 } // namespace content |
OLD | NEW |