| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/net/proxy_service_factory.h" | 5 #include "chrome/browser/net/proxy_service_factory.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 22 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 23 #include "net/proxy/proxy_config_service.h" | 23 #include "net/proxy/proxy_config_service.h" |
| 24 #include "net/proxy/proxy_resolver_v8.h" | 24 #include "net/proxy/proxy_resolver_v8.h" |
| 25 #include "net/proxy/proxy_script_fetcher_impl.h" | 25 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 26 #include "net/proxy/proxy_service.h" | 26 #include "net/proxy/proxy_service.h" |
| 27 #include "net/proxy/proxy_service_v8.h" | 27 #include "net/proxy/proxy_service_v8.h" |
| 28 #include "net/url_request/url_request_context.h" | 28 #include "net/url_request/url_request_context.h" |
| 29 | 29 |
| 30 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 31 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | |
| 32 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h" | 31 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h" |
| 32 #include "chromeos/network/proxy/proxy_config_service_impl.h" |
| 33 #endif // defined(OS_CHROMEOS) | 33 #endif // defined(OS_CHROMEOS) |
| 34 | 34 |
| 35 #if !defined(OS_ANDROID) | 35 #if !defined(OS_ANDROID) |
| 36 #include "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h" | 36 #include "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h" |
| 37 #include "net/proxy/proxy_service_mojo.h" | 37 #include "net/proxy/proxy_service_mojo.h" |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 using content::BrowserThread; | 40 using content::BrowserThread; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); | 82 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // static | 85 // static |
| 86 PrefProxyConfigTracker* | 86 PrefProxyConfigTracker* |
| 87 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 87 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 88 PrefService* profile_prefs, | 88 PrefService* profile_prefs, |
| 89 PrefService* local_state_prefs) { | 89 PrefService* local_state_prefs) { |
| 90 #if defined(OS_CHROMEOS) | 90 #if defined(OS_CHROMEOS) |
| 91 return new chromeos::ProxyConfigServiceImpl(profile_prefs, local_state_prefs); | 91 return new chromeos::ProxyConfigServiceImpl( |
| 92 profile_prefs, local_state_prefs, |
| 93 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 92 #else | 94 #else |
| 93 return new PrefProxyConfigTrackerImpl( | 95 return new PrefProxyConfigTrackerImpl( |
| 94 profile_prefs, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 96 profile_prefs, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 95 #endif // defined(OS_CHROMEOS) | 97 #endif // defined(OS_CHROMEOS) |
| 96 } | 98 } |
| 97 | 99 |
| 98 // static | 100 // static |
| 99 PrefProxyConfigTracker* | 101 PrefProxyConfigTracker* |
| 100 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 102 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 101 PrefService* local_state_prefs) { | 103 PrefService* local_state_prefs) { |
| 102 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
| 103 return new chromeos::ProxyConfigServiceImpl(NULL, local_state_prefs); | 105 return new chromeos::ProxyConfigServiceImpl( |
| 106 nullptr, local_state_prefs, |
| 107 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 104 #else | 108 #else |
| 105 return new PrefProxyConfigTrackerImpl( | 109 return new PrefProxyConfigTrackerImpl( |
| 106 local_state_prefs, | 110 local_state_prefs, |
| 107 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 111 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 108 #endif // defined(OS_CHROMEOS) | 112 #endif // defined(OS_CHROMEOS) |
| 109 } | 113 } |
| 110 | 114 |
| 111 // static | 115 // static |
| 112 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( | 116 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( |
| 113 net::NetLog* net_log, | 117 net::NetLog* net_log, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 190 } |
| 187 | 191 |
| 188 proxy_service->set_quick_check_enabled(quick_check_enabled); | 192 proxy_service->set_quick_check_enabled(quick_check_enabled); |
| 189 proxy_service->set_sanitize_url_policy( | 193 proxy_service->set_sanitize_url_policy( |
| 190 pac_https_url_stripping_enabled | 194 pac_https_url_stripping_enabled |
| 191 ? net::ProxyService::SanitizeUrlPolicy::SAFE | 195 ? net::ProxyService::SanitizeUrlPolicy::SAFE |
| 192 : net::ProxyService::SanitizeUrlPolicy::UNSAFE); | 196 : net::ProxyService::SanitizeUrlPolicy::UNSAFE); |
| 193 | 197 |
| 194 return proxy_service; | 198 return proxy_service; |
| 195 } | 199 } |
| OLD | NEW |