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> | 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 net::URLRequestContext* context, | 97 net::URLRequestContext* context, |
98 net::NetworkDelegate* network_delegate, | 98 net::NetworkDelegate* network_delegate, |
99 net::ProxyConfigService* proxy_config_service, | 99 net::ProxyConfigService* proxy_config_service, |
100 const base::CommandLine& command_line, | 100 const base::CommandLine& command_line, |
101 bool quick_check_enabled) { | 101 bool quick_check_enabled) { |
102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
103 #if defined(OS_IOS) | 103 #if defined(OS_IOS) |
104 bool use_v8 = false; | 104 bool use_v8 = false; |
105 #else | 105 #else |
106 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); | 106 bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver); |
| 107 // TODO(eroman): Figure out why this doesn't work in single-process mode. |
| 108 // Should be possible now that a private isolate is used. |
| 109 // http://crbug.com/474654 |
| 110 if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) { |
| 111 LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode."; |
| 112 use_v8 = false; // Fallback to non-v8 implementation. |
| 113 } |
107 #endif // defined(OS_IOS) | 114 #endif // defined(OS_IOS) |
108 | 115 |
109 size_t num_pac_threads = 0u; // Use default number of threads. | 116 size_t num_pac_threads = 0u; // Use default number of threads. |
110 | 117 |
111 // Check the command line for an override on the number of proxy resolver | 118 // Check the command line for an override on the number of proxy resolver |
112 // threads to use. | 119 // threads to use. |
113 if (command_line.HasSwitch(switches::kNumPacThreads)) { | 120 if (command_line.HasSwitch(switches::kNumPacThreads)) { |
114 std::string s = command_line.GetSwitchValueASCII(switches::kNumPacThreads); | 121 std::string s = command_line.GetSwitchValueASCII(switches::kNumPacThreads); |
115 | 122 |
116 // Parse the switch (it should be a positive integer formatted as decimal). | 123 // Parse the switch (it should be a positive integer formatted as decimal). |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( | 169 proxy_service = net::ProxyService::CreateUsingSystemProxyResolver( |
163 proxy_config_service, | 170 proxy_config_service, |
164 num_pac_threads, | 171 num_pac_threads, |
165 net_log); | 172 net_log); |
166 } | 173 } |
167 | 174 |
168 proxy_service->set_quick_check_enabled(quick_check_enabled); | 175 proxy_service->set_quick_check_enabled(quick_check_enabled); |
169 | 176 |
170 return proxy_service; | 177 return proxy_service; |
171 } | 178 } |
OLD | NEW |