| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/public/browser/media_device_id.h" | 4 #include "content/public/browser/media_device_id.h" |
| 5 | 5 |
| 6 #include "content/browser/browser_main_loop.h" | 6 #include "content/browser/browser_main_loop.h" |
| 7 #include "content/browser/renderer_host/media/media_stream_manager.h" | 7 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 std::string GetHMACForMediaDeviceID(const ResourceContext::SaltCallback& sc, | 11 std::string GetHMACForMediaDeviceID(const std::string& salt, |
| 12 const url::Origin& security_origin, | 12 const url::Origin& security_origin, |
| 13 const std::string& raw_unique_id) { | 13 const std::string& raw_unique_id) { |
| 14 return MediaStreamManager::GetHMACForMediaDeviceID(sc, security_origin, | 14 return MediaStreamManager::GetHMACForMediaDeviceID(salt, security_origin, |
| 15 raw_unique_id); | 15 raw_unique_id); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool DoesMediaDeviceIDMatchHMAC(const ResourceContext::SaltCallback& sc, | 18 bool DoesMediaDeviceIDMatchHMAC(const std::string& salt, |
| 19 const url::Origin& security_origin, | 19 const url::Origin& security_origin, |
| 20 const std::string& device_guid, | 20 const std::string& device_guid, |
| 21 const std::string& raw_unique_id) { | 21 const std::string& raw_unique_id) { |
| 22 return MediaStreamManager::DoesMediaDeviceIDMatchHMAC( | 22 return MediaStreamManager::DoesMediaDeviceIDMatchHMAC( |
| 23 sc, security_origin, device_guid, raw_unique_id); | 23 salt, security_origin, device_guid, raw_unique_id); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool GetMediaDeviceIDForHMAC(MediaStreamType stream_type, | 26 bool GetMediaDeviceIDForHMAC(MediaStreamType stream_type, |
| 27 const ResourceContext::SaltCallback& rc, | 27 const std::string& salt, |
| 28 const url::Origin& security_origin, | 28 const url::Origin& security_origin, |
| 29 const std::string& source_id, | 29 const std::string& source_id, |
| 30 std::string* device_id) { | 30 std::string* device_id) { |
| 31 content::MediaStreamManager* manager = | 31 content::MediaStreamManager* manager = |
| 32 content::BrowserMainLoop::GetInstance()->media_stream_manager(); | 32 content::BrowserMainLoop::GetInstance()->media_stream_manager(); |
| 33 | 33 |
| 34 return manager->TranslateSourceIdToDeviceId( | 34 return manager->TranslateSourceIdToDeviceId( |
| 35 content::MEDIA_DEVICE_VIDEO_CAPTURE, | 35 content::MEDIA_DEVICE_VIDEO_CAPTURE, salt, security_origin, source_id, |
| 36 rc, | |
| 37 security_origin, | |
| 38 source_id, | |
| 39 device_id); | 36 device_id); |
| 40 } | 37 } |
| 41 | 38 |
| 42 } // namespace content | 39 } // namespace content |
| OLD | NEW |