| 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 #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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|