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

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

Issue 1987643002: Make default media device ID salts random by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change return type from const string to string as it makes no difference Created 4 years, 6 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
« no previous file with comments | « content/public/browser/media_device_id.h ('k') | content/public/browser/resource_context.h » ('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 #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
OLDNEW
« no previous file with comments | « content/public/browser/media_device_id.h ('k') | content/public/browser/resource_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698