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

Side by Side Diff: content/shell/browser/shell_browser_context.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: Created 4 years, 7 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
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 #include "content/shell/browser/shell_browser_context.h" 5 #include "content/shell/browser/shell_browser_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 15 matching lines...) Expand all
26 #include "base/base_paths_win.h" 26 #include "base/base_paths_win.h"
27 #elif defined(OS_LINUX) 27 #elif defined(OS_LINUX)
28 #include "base/nix/xdg_util.h" 28 #include "base/nix/xdg_util.h"
29 #elif defined(OS_MACOSX) 29 #elif defined(OS_MACOSX)
30 #include "base/base_paths_mac.h" 30 #include "base/base_paths_mac.h"
31 #endif 31 #endif
32 32
33 namespace content { 33 namespace content {
34 34
35 ShellBrowserContext::ShellResourceContext::ShellResourceContext() 35 ShellBrowserContext::ShellResourceContext::ShellResourceContext()
36 : getter_(NULL) { 36 : getter_(NULL), media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {}
37 }
38 37
39 ShellBrowserContext::ShellResourceContext::~ShellResourceContext() { 38 ShellBrowserContext::ShellResourceContext::~ShellResourceContext() {
40 } 39 }
41 40
42 net::HostResolver* 41 net::HostResolver*
43 ShellBrowserContext::ShellResourceContext::GetHostResolver() { 42 ShellBrowserContext::ShellResourceContext::GetHostResolver() {
44 CHECK(getter_); 43 CHECK(getter_);
45 return getter_->host_resolver(); 44 return getter_->host_resolver();
46 } 45 }
47 46
48 net::URLRequestContext* 47 net::URLRequestContext*
49 ShellBrowserContext::ShellResourceContext::GetRequestContext() { 48 ShellBrowserContext::ShellResourceContext::GetRequestContext() {
50 CHECK(getter_); 49 CHECK(getter_);
51 return getter_->GetURLRequestContext(); 50 return getter_->GetURLRequestContext();
52 } 51 }
53 52
53 ResourceContext::SaltCallback
54 ShellBrowserContext::ShellResourceContext::GetMediaDeviceIDSalt() {
55 return CreateSaltCallback(media_device_id_salt_);
56 }
57
54 ShellBrowserContext::ShellBrowserContext(bool off_the_record, 58 ShellBrowserContext::ShellBrowserContext(bool off_the_record,
55 net::NetLog* net_log) 59 net::NetLog* net_log)
56 : resource_context_(new ShellResourceContext), 60 : resource_context_(new ShellResourceContext),
57 ignore_certificate_errors_(false), 61 ignore_certificate_errors_(false),
58 off_the_record_(off_the_record), 62 off_the_record_(off_the_record),
59 net_log_(net_log), 63 net_log_(net_log),
60 guest_manager_(NULL) { 64 guest_manager_(NULL) {
61 InitWhileIOAllowed(); 65 InitWhileIOAllowed();
62 } 66 }
63 67
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return permission_manager_.get(); 198 return permission_manager_.get();
195 } 199 }
196 200
197 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() { 201 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() {
198 if (!background_sync_controller_) 202 if (!background_sync_controller_)
199 background_sync_controller_.reset(new MockBackgroundSyncController()); 203 background_sync_controller_.reset(new MockBackgroundSyncController());
200 return background_sync_controller_.get(); 204 return background_sync_controller_.get();
201 } 205 }
202 206
203 } // namespace content 207 } // namespace content
OLDNEW
« blimp/engine/common/blimp_browser_context.cc ('K') | « content/shell/browser/shell_browser_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698