| 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 // MediaStreamManager is used to open/enumerate media capture devices (video | 5 // MediaStreamManager is used to open/enumerate media capture devices (video |
| 6 // supported now). Call flow: | 6 // supported now). Call flow: |
| 7 // 1. GenerateStream is called when a render process wants to use a capture | 7 // 1. GenerateStream is called when a render process wants to use a capture |
| 8 // device. | 8 // device. |
| 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to | 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to |
| 10 // use devices and for which device to use. | 10 // use devices and for which device to use. |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 static bool DoesMediaDeviceIDMatchHMAC( | 252 static bool DoesMediaDeviceIDMatchHMAC( |
| 253 const ResourceContext::SaltCallback& sc, | 253 const ResourceContext::SaltCallback& sc, |
| 254 const url::Origin& security_origin, | 254 const url::Origin& security_origin, |
| 255 const std::string& device_guid, | 255 const std::string& device_guid, |
| 256 const std::string& raw_unique_id); | 256 const std::string& raw_unique_id); |
| 257 | 257 |
| 258 // Returns true if the renderer process identified with |render_process_id| | 258 // Returns true if the renderer process identified with |render_process_id| |
| 259 // is allowed to access |origin|. | 259 // is allowed to access |origin|. |
| 260 static bool IsOriginAllowed(int render_process_id, const url::Origin& origin); | 260 static bool IsOriginAllowed(int render_process_id, const url::Origin& origin); |
| 261 | 261 |
| 262 // Set whether the capturing is secure for the capturing session with given |
| 263 // |session_id|, |render_process_id|, and the MediaStreamType |type|. |
| 264 void SetCapturingLinkSecured(int render_process_id, |
| 265 int session_id, |
| 266 content::MediaStreamType type, |
| 267 bool is_secure); |
| 268 |
| 262 private: | 269 private: |
| 263 // Contains all data needed to keep track of requests. | 270 // Contains all data needed to keep track of requests. |
| 264 class DeviceRequest; | 271 class DeviceRequest; |
| 265 | 272 |
| 266 // Cache enumerated device list. | 273 // Cache enumerated device list. |
| 267 struct EnumerationCache { | 274 struct EnumerationCache { |
| 268 EnumerationCache(); | 275 EnumerationCache(); |
| 269 ~EnumerationCache(); | 276 ~EnumerationCache(); |
| 270 | 277 |
| 271 bool valid; | 278 bool valid; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 469 |
| 463 // Objects subscribed to changes in the set of media devices. | 470 // Objects subscribed to changes in the set of media devices. |
| 464 std::vector<MediaStreamRequester*> device_change_subscribers_; | 471 std::vector<MediaStreamRequester*> device_change_subscribers_; |
| 465 | 472 |
| 466 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 473 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
| 467 }; | 474 }; |
| 468 | 475 |
| 469 } // namespace content | 476 } // namespace content |
| 470 | 477 |
| 471 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 478 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
| OLD | NEW |