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

Side by Side Diff: media/audio/audio_manager_base.h

Issue 2503693002: Tracks all open input streams in AudioManagerBase. (Closed)
Patch Set: close fake streams explicitly Created 4 years, 1 month 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
« no previous file with comments | « no previous file | media/audio/audio_manager_base.cc » ('j') | media/audio/mac/audio_manager_mac.cc » ('J')
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 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_
6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <unordered_set>
10 #include <utility> 11 #include <utility>
11 12
12 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_vector.h" 15 #include "base/memory/scoped_vector.h"
15 #include "base/observer_list.h" 16 #include "base/observer_list.h"
16 #include "base/threading/thread.h" 17 #include "base/threading/thread.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "media/audio/audio_manager.h" 19 #include "media/audio/audio_manager.h"
19 #include "media/audio/audio_output_dispatcher.h" 20 #include "media/audio/audio_output_dispatcher.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 // Number of currently open output streams. 155 // Number of currently open output streams.
155 int num_output_streams_; 156 int num_output_streams_;
156 157
157 // Number of currently open input streams. 158 // Number of currently open input streams.
158 int num_input_streams_; 159 int num_input_streams_;
159 160
160 // Track output state change listeners. 161 // Track output state change listeners.
161 base::ObserverList<AudioDeviceListener> output_listeners_; 162 base::ObserverList<AudioDeviceListener> output_listeners_;
162 163
164 // Contains currently open fake input/output streams.
165 // TODO(alokp): Remove this after tracking down streams that are not closed
166 // before shutdown: crbug.com/608049.
167 std::unordered_set<AudioOutputStream*> fake_output_streams_;
168 std::unordered_set<AudioInputStream*> fake_input_streams_;
169
163 // Map of cached AudioOutputDispatcher instances. Must only be touched 170 // Map of cached AudioOutputDispatcher instances. Must only be touched
164 // from the audio thread (no locking). 171 // from the audio thread (no locking).
165 AudioOutputDispatchers output_dispatchers_; 172 AudioOutputDispatchers output_dispatchers_;
166 173
167 // Proxy for creating AudioLog objects. 174 // Proxy for creating AudioLog objects.
168 AudioLogFactory* const audio_log_factory_; 175 AudioLogFactory* const audio_log_factory_;
169 176
170 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); 177 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase);
171 }; 178 };
172 179
173 } // namespace media 180 } // namespace media
174 181
175 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ 182 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_manager_base.cc » ('j') | media/audio/mac/audio_manager_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698