Chromium Code Reviews| 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 capturing is in process, and return if it is secure in | |
| 155 // |is_link_secure|. The capturing is secure if all video sinks are reported | |
| 156 // secure and the extension is white listed for casting. | |
|
miu
2016/04/16 00:05:29
s/extension is white listed for casting/extension
xjz
2016/04/21 23:50:45
Done.
| |
| 157 bool IsCaptureInProgress(int render_process_id, | |
| 158 int render_frame_id, | |
| 159 bool* is_link_secure); | |
|
miu
2016/04/16 00:05:29
Can you eliminate the 3rd argument, and just retur
xjz
2016/04/21 23:50:45
Done. Initially I thought we need to report if cap
| |
| 160 | |
| 147 // Only for testing. | 161 // Only for testing. |
| 148 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); | 162 void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices); |
| 149 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); | 163 void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices); |
| 150 | 164 |
| 151 private: | 165 private: |
| 152 friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>; | 166 friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>; |
| 153 | 167 |
| 154 MediaCaptureDevicesDispatcher(); | 168 MediaCaptureDevicesDispatcher(); |
| 155 ~MediaCaptureDevicesDispatcher() override; | 169 ~MediaCaptureDevicesDispatcher() override; |
| 156 | 170 |
| 157 // Called by the MediaObserver() functions, executed on UI thread. | 171 // Called by the MediaObserver() functions, executed on UI thread. |
| 158 void NotifyAudioDevicesChangedOnUIThread(); | 172 void NotifyAudioDevicesChangedOnUIThread(); |
| 159 void NotifyVideoDevicesChangedOnUIThread(); | 173 void NotifyVideoDevicesChangedOnUIThread(); |
| 160 void UpdateMediaRequestStateOnUIThread( | 174 void UpdateMediaRequestStateOnUIThread( |
| 161 int render_process_id, | 175 int render_process_id, |
| 162 int render_frame_id, | 176 int render_frame_id, |
| 163 int page_request_id, | 177 int page_request_id, |
| 164 const GURL& security_origin, | 178 const GURL& security_origin, |
| 165 content::MediaStreamType stream_type, | 179 content::MediaStreamType stream_type, |
| 166 content::MediaRequestState state); | 180 content::MediaRequestState state); |
| 167 void OnCreatingAudioStreamOnUIThread(int render_process_id, | 181 void OnCreatingAudioStreamOnUIThread(int render_process_id, |
| 168 int render_frame_id); | 182 int render_frame_id); |
| 183 void UpdateCapturingLinkSecured(int render_process_id, | |
| 184 int render_frame_id, | |
| 185 int page_request_id, | |
| 186 content::MediaStreamType stream_type, | |
| 187 bool is_secure); | |
| 169 | 188 |
| 170 // Only for testing, a list of cached audio capture devices. | 189 // Only for testing, a list of cached audio capture devices. |
| 171 content::MediaStreamDevices test_audio_devices_; | 190 content::MediaStreamDevices test_audio_devices_; |
| 172 | 191 |
| 173 // Only for testing, a list of cached video capture devices. | 192 // Only for testing, a list of cached video capture devices. |
| 174 content::MediaStreamDevices test_video_devices_; | 193 content::MediaStreamDevices test_video_devices_; |
| 175 | 194 |
| 176 // A list of observers for the device update notifications. | 195 // A list of observers for the device update notifications. |
| 177 base::ObserverList<Observer> observers_; | 196 base::ObserverList<Observer> observers_; |
| 178 | 197 |
| 179 // Flag used by unittests to disable device enumeration. | 198 // Flag used by unittests to disable device enumeration. |
| 180 bool is_device_enumeration_disabled_; | 199 bool is_device_enumeration_disabled_; |
| 181 | 200 |
| 182 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; | 201 scoped_refptr<MediaStreamCaptureIndicator> media_stream_capture_indicator_; |
| 183 | 202 |
| 184 std::unique_ptr<DesktopStreamsRegistry> desktop_streams_registry_; | 203 std::unique_ptr<DesktopStreamsRegistry> desktop_streams_registry_; |
| 185 | 204 |
| 186 // Handlers for processing media access requests. | 205 // Handlers for processing media access requests. |
| 187 ScopedVector<MediaAccessHandler> media_access_handlers_; | 206 ScopedVector<MediaAccessHandler> media_access_handlers_; |
| 188 | 207 |
| 189 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); | 208 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); |
| 190 }; | 209 }; |
| 191 | 210 |
| 192 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 211 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
| OLD | NEW |