| 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 <string> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 11 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/io_thread.h" | 14 #include "chrome/browser/io_thread.h" |
| 13 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" | 15 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" |
| 16 #include "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h" |
| 14 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 15 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 16 #include "net/base/net_log.h" | 19 #include "net/base/net_log.h" |
| 17 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 20 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 18 #include "net/proxy/proxy_config_service.h" | 21 #include "net/proxy/proxy_config_service.h" |
| 19 #include "net/proxy/proxy_script_fetcher_impl.h" | 22 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 20 #include "net/proxy/proxy_service.h" | 23 #include "net/proxy/proxy_service.h" |
| 21 #include "net/proxy/proxy_service_v8.h" | 24 #include "net/proxy/proxy_service_v8.h" |
| 22 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
| 23 | 26 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 #else | 133 #else |
| 131 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; | 134 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; |
| 132 #if defined(OS_CHROMEOS) | 135 #if defined(OS_CHROMEOS) |
| 133 dhcp_proxy_script_fetcher = | 136 dhcp_proxy_script_fetcher = |
| 134 new chromeos::DhcpProxyScriptFetcherChromeos(context); | 137 new chromeos::DhcpProxyScriptFetcherChromeos(context); |
| 135 #else | 138 #else |
| 136 net::DhcpProxyScriptFetcherFactory dhcp_factory; | 139 net::DhcpProxyScriptFetcherFactory dhcp_factory; |
| 137 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); | 140 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); |
| 138 #endif | 141 #endif |
| 139 | 142 |
| 140 if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { | 143 if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess)) { |
| 144 proxy_service = net::CreateProxyServiceUsingMojoFactory( |
| 145 chrome_browser_net::UtilityProcessMojoProxyResolverFactory:: |
| 146 GetInstance(), |
| 147 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 148 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 149 network_delegate); |
| 150 } else if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { |
| 141 proxy_service = net::CreateProxyServiceUsingMojoInProcess( | 151 proxy_service = net::CreateProxyServiceUsingMojoInProcess( |
| 142 proxy_config_service, new net::ProxyScriptFetcherImpl(context), | 152 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 143 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, | 153 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 144 network_delegate); | 154 network_delegate); |
| 145 } else { | 155 } else { |
| 146 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( | 156 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( |
| 147 proxy_config_service, new net::ProxyScriptFetcherImpl(context), | 157 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 148 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, | 158 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 149 network_delegate); | 159 network_delegate); |
| 150 } | 160 } |
| 151 #endif // defined(OS_IOS) | 161 #endif // defined(OS_IOS) |
| 152 } else { | 162 } else { |
| 153 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 163 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
| 154 proxy_config_service, | 164 proxy_config_service, |
| 155 num_pac_threads, | 165 num_pac_threads, |
| 156 net_log); | 166 net_log); |
| 157 } | 167 } |
| 158 | 168 |
| 159 proxy_service->set_quick_check_enabled(quick_check_enabled); | 169 proxy_service->set_quick_check_enabled(quick_check_enabled); |
| 160 | 170 |
| 161 return proxy_service; | 171 return proxy_service; |
| 162 } | 172 } |
| OLD | NEW |