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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 #else | 130 #else |
130 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; | 131 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; |
131 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
132 dhcp_proxy_script_fetcher = | 133 dhcp_proxy_script_fetcher = |
133 new chromeos::DhcpProxyScriptFetcherChromeos(context); | 134 new chromeos::DhcpProxyScriptFetcherChromeos(context); |
134 #else | 135 #else |
135 net::DhcpProxyScriptFetcherFactory dhcp_factory; | 136 net::DhcpProxyScriptFetcherFactory dhcp_factory; |
136 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); | 137 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); |
137 #endif | 138 #endif |
138 | 139 |
139 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( | 140 if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { |
140 proxy_config_service, | 141 proxy_service = net::CreateProxyServiceUsingMojoInProcess( |
141 new net::ProxyScriptFetcherImpl(context), | 142 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
142 dhcp_proxy_script_fetcher, | 143 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
143 context->host_resolver(), | 144 network_delegate); |
144 net_log, | 145 } else { |
145 network_delegate); | 146 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( |
| 147 proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
| 148 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
| 149 network_delegate); |
| 150 } |
146 #endif // defined(OS_IOS) | 151 #endif // defined(OS_IOS) |
147 } else { | 152 } else { |
148 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 153 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
149 proxy_config_service, | 154 proxy_config_service, |
150 num_pac_threads, | 155 num_pac_threads, |
151 net_log); | 156 net_log); |
152 } | 157 } |
153 | 158 |
154 proxy_service->set_quick_check_enabled(quick_check_enabled); | 159 proxy_service->set_quick_check_enabled(quick_check_enabled); |
155 | 160 |
156 return proxy_service; | 161 return proxy_service; |
157 } | 162 } |
OLD | NEW |