Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: chrome/browser/net/proxy_service_factory.cc

Issue 1128453004: Embed a simple Mojo shell in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 14 matching lines...) Expand all
25 #if defined(OS_CHROMEOS) 25 #if defined(OS_CHROMEOS)
26 #include "chrome/browser/chromeos/proxy_config_service_impl.h" 26 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
27 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h" 27 #include "chromeos/network/dhcp_proxy_script_fetcher_chromeos.h"
28 #endif // defined(OS_CHROMEOS) 28 #endif // defined(OS_CHROMEOS)
29 29
30 #if !defined(OS_IOS) 30 #if !defined(OS_IOS)
31 #include "net/proxy/proxy_resolver_v8.h" 31 #include "net/proxy/proxy_resolver_v8.h"
32 #endif 32 #endif
33 33
34 #if !defined(OS_IOS) && !defined(OS_ANDROID) 34 #if !defined(OS_IOS) && !defined(OS_ANDROID)
35 #include "chrome/browser/net/utility_process_mojo_proxy_resolver_factory.h" 35 #include "chrome/browser/net/mojo_app_proxy_resolver_factory.h"
36 #include "net/proxy/proxy_service_mojo.h" 36 #include "net/proxy/proxy_service_mojo.h"
37 #endif 37 #endif
38 38
39 using content::BrowserThread; 39 using content::BrowserThread;
40 40
41 // static 41 // static
42 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( 42 net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService(
43 PrefProxyConfigTracker* tracker) { 43 PrefProxyConfigTracker* tracker) {
44 // The linux gconf-based proxy settings getter relies on being initialized 44 // The linux gconf-based proxy settings getter relies on being initialized
45 // from the UI thread. 45 // from the UI thread.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher; 137 net::DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher;
138 #if defined(OS_CHROMEOS) 138 #if defined(OS_CHROMEOS)
139 dhcp_proxy_script_fetcher = 139 dhcp_proxy_script_fetcher =
140 new chromeos::DhcpProxyScriptFetcherChromeos(context); 140 new chromeos::DhcpProxyScriptFetcherChromeos(context);
141 #else 141 #else
142 net::DhcpProxyScriptFetcherFactory dhcp_factory; 142 net::DhcpProxyScriptFetcherFactory dhcp_factory;
143 dhcp_proxy_script_fetcher = dhcp_factory.Create(context); 143 dhcp_proxy_script_fetcher = dhcp_factory.Create(context);
144 #endif 144 #endif
145 145
146 #if !defined(OS_ANDROID) 146 #if !defined(OS_ANDROID)
147 if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess)) { 147 if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess) ||
148 command_line.HasSwitch(switches::kV8PacMojoInProcess)) {
148 proxy_service = net::CreateProxyServiceUsingMojoFactory( 149 proxy_service = net::CreateProxyServiceUsingMojoFactory(
149 UtilityProcessMojoProxyResolverFactory::GetInstance(), 150 MojoAppProxyResolverFactory::GetInstance(), proxy_config_service,
150 proxy_config_service, new net::ProxyScriptFetcherImpl(context), 151 new net::ProxyScriptFetcherImpl(context), dhcp_proxy_script_fetcher,
151 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, 152 context->host_resolver(), net_log, network_delegate);
152 network_delegate);
153 } else if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) {
154 proxy_service = net::CreateProxyServiceUsingMojoInProcess(
155 proxy_config_service, new net::ProxyScriptFetcherImpl(context),
156 dhcp_proxy_script_fetcher, context->host_resolver(), net_log,
157 network_delegate);
158 } 153 }
159 #endif // !defined(OS_ANDROID) 154 #endif // !defined(OS_ANDROID)
160 155
161 if (!proxy_service) { 156 if (!proxy_service) {
162 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver( 157 proxy_service = net::CreateProxyServiceUsingV8ProxyResolver(
163 proxy_config_service, new net::ProxyScriptFetcherImpl(context), 158 proxy_config_service, new net::ProxyScriptFetcherImpl(context),
164 dhcp_proxy_script_fetcher, context->host_resolver(), net_log, 159 dhcp_proxy_script_fetcher, context->host_resolver(), net_log,
165 network_delegate); 160 network_delegate);
166 } 161 }
167 #endif // defined(OS_IOS) 162 #endif // defined(OS_IOS)
168 } else { 163 } else {
169 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( 164 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver(
170 proxy_config_service, 165 proxy_config_service,
171 num_pac_threads, 166 num_pac_threads,
172 net_log); 167 net_log);
173 } 168 }
174 169
175 proxy_service->set_quick_check_enabled(quick_check_enabled); 170 proxy_service->set_quick_check_enabled(quick_check_enabled);
176 171
177 return proxy_service; 172 return proxy_service;
178 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698