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

Side by Side Diff: content/browser/renderer_host/media/audio_output_device_enumerator.h

Issue 1602083003: Correctly handle enumerations for AudioManagers that report only the default audio output device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: variable name change Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 // AudioOutputDeviceEnumerator is used to enumerate audio output devices. 5 // AudioOutputDeviceEnumerator is used to enumerate audio output devices.
6 // It can return cached results of previous enumerations in order to boost 6 // It can return cached results of previous enumerations in order to boost
7 // performance. 7 // performance.
8 // All its public methods must be called on the thread where the object is 8 // All its public methods must be called on the thread where the object is
9 // created. 9 // created.
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 // AudioOutputDeviceInfo describes information about an audio output device. 37 // AudioOutputDeviceInfo describes information about an audio output device.
38 // The enumerations returned by AudioOutputDeviceEnumerator::Enumerate() contain 38 // The enumerations returned by AudioOutputDeviceEnumerator::Enumerate() contain
39 // elements of this type. It is used only in the browser side. 39 // elements of this type. It is used only in the browser side.
40 struct AudioOutputDeviceInfo { 40 struct AudioOutputDeviceInfo {
41 std::string unique_id; 41 std::string unique_id;
42 std::string device_name; 42 std::string device_name;
43 media::AudioParameters output_params; 43 media::AudioParameters output_params;
44 }; 44 };
45 45
46 typedef std::vector<AudioOutputDeviceInfo> AudioOutputDeviceEnumeration; 46 struct AudioOutputDeviceEnumeration {
47 public:
48 AudioOutputDeviceEnumeration(
49 const std::vector<AudioOutputDeviceInfo>& devices,
50 bool has_actual_devices);
51 AudioOutputDeviceEnumeration();
52 ~AudioOutputDeviceEnumeration();
53
54 std::vector<AudioOutputDeviceInfo> devices;
55 bool has_actual_devices;
56 };
57
47 typedef base::Callback<void(const AudioOutputDeviceEnumeration&)> 58 typedef base::Callback<void(const AudioOutputDeviceEnumeration&)>
48 AudioOutputDeviceEnumerationCB; 59 AudioOutputDeviceEnumerationCB;
49 60
50 class CONTENT_EXPORT AudioOutputDeviceEnumerator { 61 class CONTENT_EXPORT AudioOutputDeviceEnumerator {
51 public: 62 public:
52 enum CachePolicy { 63 enum CachePolicy {
53 CACHE_POLICY_NO_CACHING, 64 CACHE_POLICY_NO_CACHING,
54 CACHE_POLICY_MANUAL_INVALIDATION 65 CACHE_POLICY_MANUAL_INVALIDATION
55 }; 66 };
56 AudioOutputDeviceEnumerator(media::AudioManager* audio_manager, 67 AudioOutputDeviceEnumerator(media::AudioManager* audio_manager,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 109
99 base::ThreadChecker thread_checker_; 110 base::ThreadChecker thread_checker_;
100 base::WeakPtrFactory<AudioOutputDeviceEnumerator> weak_factory_; 111 base::WeakPtrFactory<AudioOutputDeviceEnumerator> weak_factory_;
101 112
102 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceEnumerator); 113 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceEnumerator);
103 }; 114 };
104 115
105 } // namespace content 116 } // namespace content
106 117
107 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DEVICE_ENUMERATOR_H_ 118 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DEVICE_ENUMERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698