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 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 void OnAudioCaptureDevicesChanged() override; | 130 void OnAudioCaptureDevicesChanged() override; |
131 void OnVideoCaptureDevicesChanged() override; | 131 void OnVideoCaptureDevicesChanged() override; |
132 void OnMediaRequestStateChanged(int render_process_id, | 132 void OnMediaRequestStateChanged(int render_process_id, |
133 int render_frame_id, | 133 int render_frame_id, |
134 int page_request_id, | 134 int page_request_id, |
135 const GURL& security_origin, | 135 const GURL& security_origin, |
136 content::MediaStreamType stream_type, | 136 content::MediaStreamType stream_type, |
137 content::MediaRequestState state) override; | 137 content::MediaRequestState state) override; |
138 void OnCreatingAudioStream(int render_process_id, | 138 void OnCreatingAudioStream(int render_process_id, |
139 int render_frame_id) override; | 139 int render_frame_id) override; |
140 void OnSetCapturingLinkSecured(int render_process_id, | |
141 int render_frame_id, | |
142 int page_request_id, | |
143 content::MediaStreamType stream_type, | |
144 bool is_secure) override; | |
140 | 145 |
141 scoped_refptr<MediaStreamCaptureIndicator> GetMediaStreamCaptureIndicator(); | 146 scoped_refptr<MediaStreamCaptureIndicator> GetMediaStreamCaptureIndicator(); |
142 | 147 |
143 DesktopStreamsRegistry* GetDesktopStreamsRegistry(); | 148 DesktopStreamsRegistry* GetDesktopStreamsRegistry(); |
144 | 149 |
150 // TODO(xjz): remove this after output protection changes to use | |
151 // |IsCaptureInProgress()| for checking. | |
145 bool IsDesktopCaptureInProgress(); | 152 bool IsDesktopCaptureInProgress(); |
146 | 153 |
154 // Check if any capture is in process, and return if it has secure link in | |
155 // |is_link_secure|. | |
xhwang
2016/04/12 22:18:50
We are more interested in whether all links are se
xjz
2016/04/12 22:29:08
Yes. |is_link_secure| is true only when all links
| |
156 bool IsCaptureInProgress(int render_process_id, | |
157 int render_frame_id, | |
158 bool* is_link_secure); | |
xhwang
2016/04/12 22:18:49
Does this cover all capturing cases, e.g. desktop/
xjz
2016/04/12 22:29:07
Yes.
| |
159 | |
147 // Only for testing. | 160 // Only for testing. |
148 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); | 161 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); |
149 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); | 162 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); |
150 | 163 |
151 private: | 164 private: |
152 friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>; | 165 friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>; |
153 | 166 |
154 MediaCaptureDevicesDispatcher(); | 167 MediaCaptureDevicesDispatcher(); |
155 ~MediaCaptureDevicesDispatcher() override; | 168 ~MediaCaptureDevicesDispatcher() override; |
156 | 169 |
157 // Called by the MediaObserver() functions, executed on UI thread. | 170 // Called by the MediaObserver() functions, executed on UI thread. |
158 void NotifyAudioDevicesChangedOnUIThread(); | 171 void NotifyAudioDevicesChangedOnUIThread(); |
159 void NotifyVideoDevicesChangedOnUIThread(); | 172 void NotifyVideoDevicesChangedOnUIThread(); |
160 void UpdateMediaRequestStateOnUIThread( | 173 void UpdateMediaRequestStateOnUIThread( |
161 int render_process_id, | 174 int render_process_id, |
162 int render_frame_id, | 175 int render_frame_id, |
163 int page_request_id, | 176 int page_request_id, |
164 const GURL& security_origin, | 177 const GURL& security_origin, |
165 content::MediaStreamType stream_type, | 178 content::MediaStreamType stream_type, |
166 content::MediaRequestState state); | 179 content::MediaRequestState state); |
167 void OnCreatingAudioStreamOnUIThread(int render_process_id, | 180 void OnCreatingAudioStreamOnUIThread(int render_process_id, |
168 int render_frame_id); | 181 int render_frame_id); |
182 void UpdateCapturingLinkSecured(int render_process_id, | |
183 int render_frame_id, | |
184 int page_request_id, | |
185 content::MediaStreamType stream_type, | |
186 bool is_secure); | |
169 | 187 |
170 // Only for testing, a list of cached audio capture devices. | 188 // Only for testing, a list of cached audio capture devices. |
171 content::MediaStreamDevices test_audio_devices_; | 189 content::MediaStreamDevices test_audio_devices_; |
172 | 190 |
173 // Only for testing, a list of cached video capture devices. | 191 // Only for testing, a list of cached video capture devices. |
174 content::MediaStreamDevices test_video_devices_; | 192 content::MediaStreamDevices test_video_devices_; |
175 | 193 |
176 // A list of observers for the device update notifications. | 194 // A list of observers for the device update notifications. |
177 base::ObserverList<Observer> observers_; | 195 base::ObserverList<Observer> observers_; |
178 | 196 |
179 // Flag used by unittests to disable device enumeration. | 197 // Flag used by unittests to disable device enumeration. |
180 bool is_device_enumeration_disabled_; | 198 bool is_device_enumeration_disabled_; |
181 | 199 |
182 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; | 200 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; |
183 | 201 |
184 std::unique_ptr<DesktopStreamsRegistry> desktop_streams_registry_; | 202 std::unique_ptr<DesktopStreamsRegistry> desktop_streams_registry_; |
185 | 203 |
186 // Handlers for processing media access requests. | 204 // Handlers for processing media access requests. |
187 ScopedVector<MediaAccessHandler> media_access_handlers_; | 205 ScopedVector<MediaAccessHandler> media_access_handlers_; |
188 | 206 |
189 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); | 207 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); |
190 }; | 208 }; |
191 | 209 |
192 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 210 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
OLD | NEW |