| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "net/proxy/proxy_service_v8.h" | 21 #include "net/proxy/proxy_service_v8.h" |
| 22 #include "net/url_request/url_request_context.h" | 22 #include "net/url_request/url_request_context.h" |
| 23 | 23 |
| 24 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
| 25 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 25 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 26 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h" | 26 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h" |
| 27 #endif // defined(OS_CHROMEOS) | 27 #endif // defined(OS_CHROMEOS) |
| 28 | 28 |
| 29 #if !defined(OS_IOS) | 29 #if !defined(OS_IOS) |
| 30 #include "net/proxy/proxy_resolver_v8.h" | 30 #include "net/proxy/proxy_resolver_v8.h" |
| 31 #include "net/proxy/proxy_service_mojo.h" |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 using content::BrowserThread; | 34 using content::BrowserThread; |
| 34 | 35 |
| 35 // static | 36 // static |
| 36 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( | 37 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( |
| 37 PrefProxyConfigTracker* tracker) { | 38 PrefProxyConfigTracker* tracker) { |
| 38 // The linux gconf-based proxy settings getter relies on being initialized | 39 // The linux gconf-based proxy settings getter relies on being initialized |
| 39 // from the UI thread. | 40 // from the UI thread. |
| 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 138 |
| 138 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; | 139 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; |
| 139 #if defined(OS_CHROMEOS) | 140 #if defined(OS_CHROMEOS) |
| 140 dhcp_proxy_script_fetcher = | 141 dhcp_proxy_script_fetcher = |
| 141 new chromeos::DhcpProxyScriptFetcherChromeos(context); | 142 new chromeos::DhcpProxyScriptFetcherChromeos(context); |
| 142 #else | 143 #else |
| 143 net::DhcpProxyScriptFetcherFactory dhcp_factory; | 144 net::DhcpProxyScriptFetcherFactory dhcp_factory; |
| 144 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); | 145 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); |
| 145 #endif | 146 #endif |
| 146 | 147 |
| 147 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( | 148 if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { |
| 148 proxy_config_service, | 149 proxy_service = net::CreateProxyServiceUsingMojoInProcess( |
| 149 new net::ProxyScriptFetcherImpl(context), | 150 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 150 dhcp_proxy_script_fetcher, | 151 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 151 context->host_resolver(), | 152 network_delegate); |
| 152 net_log, | 153 } else { |
| 153 network_delegate); | 154 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( |
| 155 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 156 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 157 network_delegate); |
| 158 } |
| 154 #endif // defined(OS_IOS) | 159 #endif // defined(OS_IOS) |
| 155 } else { | 160 } else { |
| 156 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 161 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
| 157 proxy_config_service, | 162 proxy_config_service, |
| 158 num_pac_threads, | 163 num_pac_threads, |
| 159 net_log); | 164 net_log); |
| 160 } | 165 } |
| 161 | 166 |
| 162 proxy_service->set_quick_check_enabled(quick_check_enabled); | 167 proxy_service->set_quick_check_enabled(quick_check_enabled); |
| 163 | 168 |
| 164 return proxy_service; | 169 return proxy_service; |
| 165 } | 170 } |
| OLD | NEW |