| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 const url::Origin& security_origin, | 245 const url::Origin& security_origin, |
| 246 const std::string& raw_unique_id); | 246 const std::string& raw_unique_id); |
| 247 | 247 |
| 248 // Convenience method to check if |device_guid| is an HMAC of | 248 // Convenience method to check if |device_guid| is an HMAC of |
| 249 // |raw_device_id| for |security_origin|. | 249 // |raw_device_id| for |security_origin|. |
| 250 static bool DoesMediaDeviceIDMatchHMAC(const std::string& salt, | 250 static bool DoesMediaDeviceIDMatchHMAC(const std::string& salt, |
| 251 const url::Origin& security_origin, | 251 const url::Origin& security_origin, |
| 252 const std::string& device_guid, | 252 const std::string& device_guid, |
| 253 const std::string& raw_unique_id); | 253 const std::string& raw_unique_id); |
| 254 | 254 |
| 255 static bool IsValidDeviceId(const std::string& device_id); |
| 256 |
| 255 // Returns true if the renderer process identified with |render_process_id| | 257 // Returns true if the renderer process identified with |render_process_id| |
| 256 // is allowed to access |origin|. | 258 // is allowed to access |origin|. |
| 257 static bool IsOriginAllowed(int render_process_id, const url::Origin& origin); | 259 static bool IsOriginAllowed(int render_process_id, const url::Origin& origin); |
| 258 | 260 |
| 259 // Set whether the capturing is secure for the capturing session with given | 261 // Set whether the capturing is secure for the capturing session with given |
| 260 // |session_id|, |render_process_id|, and the MediaStreamType |type|. | 262 // |session_id|, |render_process_id|, and the MediaStreamType |type|. |
| 261 void SetCapturingLinkSecured(int render_process_id, | 263 void SetCapturingLinkSecured(int render_process_id, |
| 262 int session_id, | 264 int session_id, |
| 263 content::MediaStreamType type, | 265 content::MediaStreamType type, |
| 264 bool is_secure); | 266 bool is_secure); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 std::vector<MediaStreamRequester*> device_change_subscribers_; | 460 std::vector<MediaStreamRequester*> device_change_subscribers_; |
| 459 | 461 |
| 460 GenerateStreamTestCallback generate_stream_test_callback_; | 462 GenerateStreamTestCallback generate_stream_test_callback_; |
| 461 | 463 |
| 462 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 464 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
| 463 }; | 465 }; |
| 464 | 466 |
| 465 } // namespace content | 467 } // namespace content |
| 466 | 468 |
| 467 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 469 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
| OLD | NEW |