Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: content/public/browser/media_device_id.h

Issue 143003031: Allow retrieval of media device ID salt even after ResourceContext has gone away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO about proper fix. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/public/browser/media_device_id.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/public/browser/resource_context.h"
16 #include "url/gurl.h" 17 #include "url/gurl.h"
17 18
18 namespace content { 19 namespace content {
19 20
20 class ResourceContext;
21
22 // Generates a one-way hash of a device's unique ID usable by one 21 // Generates a one-way hash of a device's unique ID usable by one
23 // particular security origin. 22 // particular security origin.
24 CONTENT_EXPORT std::string GetHMACForMediaDeviceID( 23 CONTENT_EXPORT std::string GetHMACForMediaDeviceID(
25 ResourceContext* rc, 24 const ResourceContext::SaltCallback& sc,
26 const GURL& security_origin, 25 const GURL& security_origin,
27 const std::string& raw_unique_id); 26 const std::string& raw_unique_id);
28 27
29 // Convenience method to check if |device_guid| is an HMAC of 28 // Convenience method to check if |device_guid| is an HMAC of
30 // |raw_device_id| for |security_origin|. 29 // |raw_device_id| for |security_origin|.
31 CONTENT_EXPORT bool DoesMediaDeviceIDMatchHMAC( 30 CONTENT_EXPORT bool DoesMediaDeviceIDMatchHMAC(
32 ResourceContext* rc, 31 const ResourceContext::SaltCallback& sc,
33 const GURL& security_origin, 32 const GURL& security_origin,
34 const std::string& device_guid, 33 const std::string& device_guid,
35 const std::string& raw_unique_id); 34 const std::string& raw_unique_id);
36 35
37 } // namespace content 36 } // namespace content
38 37
39 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_ 38 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_DEVICE_ID_H_
OLDNEW
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/public/browser/media_device_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698