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 // | 4 // |
5 // Media device IDs come in two flavors: The machine-wide unique ID of | 5 // Media device IDs come in two flavors: The machine-wide unique ID of |
6 // the device, which is what we use on the browser side, and one-way | 6 // the device, which is what we use on the browser side, and one-way |
7 // hashes over the unique ID and a security origin, which we provide | 7 // hashes over the unique ID and a security origin, which we provide |
8 // to code on the renderer side as per-security-origin IDs. | 8 // to code on the renderer side as per-security-origin IDs. |
9 | 9 |
10 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ | 10 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ |
11 #define CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ | 11 #define CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
| 20 class ResourceContext; |
| 21 |
20 // Generates a one-way hash of a device's unique ID usable by one | 22 // Generates a one-way hash of a device's unique ID usable by one |
21 // particular security origin. | 23 // particular security origin. |
22 CONTENT_EXPORT std::string GetHMACForMediaDeviceID( | 24 CONTENT_EXPORT std::string GetHMACForMediaDeviceID( |
| 25 ResourceContext* rc, |
23 const GURL& security_origin, | 26 const GURL& security_origin, |
24 const std::string& raw_unique_id); | 27 const std::string& raw_unique_id); |
25 | 28 |
26 // Convenience method to check if |device_guid| is an HMAC of | 29 // Convenience method to check if |device_guid| is an HMAC of |
27 // |raw_device_id| for |security_origin|. | 30 // |raw_device_id| for |security_origin|. |
28 CONTENT_EXPORT bool DoesMediaDeviceIDMatchHMAC( | 31 CONTENT_EXPORT bool DoesMediaDeviceIDMatchHMAC( |
| 32 ResourceContext* rc, |
29 const GURL& security_origin, | 33 const GURL& security_origin, |
30 const std::string& device_guid, | 34 const std::string& device_guid, |
31 const std::string& raw_unique_id); | 35 const std::string& raw_unique_id); |
32 | 36 |
33 } // namespace content | 37 } // namespace content |
34 | 38 |
35 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ | 39 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ |
OLD | NEW |