OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if (rv != net::OK) | 152 if (rv != net::OK) |
153 return rv; // Failure. | 153 return rv; // Failure. |
154 | 154 |
155 if (CommandLine::ForCurrentProcess()->HasSwitch( | 155 if (CommandLine::ForCurrentProcess()->HasSwitch( |
156 switches::kSingleProcess)) { | 156 switches::kSingleProcess)) { |
157 // We can't create a standard proxy resolver in single-process mode. | 157 // We can't create a standard proxy resolver in single-process mode. |
158 // Rather than falling-back to some other implementation, fail. | 158 // Rather than falling-back to some other implementation, fail. |
159 return net::ERR_NOT_IMPLEMENTED; | 159 return net::ERR_NOT_IMPLEMENTED; |
160 } | 160 } |
161 | 161 |
162 *proxy_service = net::ProxyService::Create(config_service.release(), true, | 162 *proxy_service = net::ProxyService::CreateUsingV8ProxyResolver( |
| 163 config_service.release(), |
163 0u, this, NULL, MessageLoop::current()); | 164 0u, this, NULL, MessageLoop::current()); |
164 | 165 |
165 return net::OK; | 166 return net::OK; |
166 } | 167 } |
167 | 168 |
168 // Creates a proxy config service that pulls from the system proxy settings. | 169 // Creates a proxy config service that pulls from the system proxy settings. |
169 // On success returns net::OK and fills |config_service| with a new pointer. | 170 // On success returns net::OK and fills |config_service| with a new pointer. |
170 // Otherwise returns a network error code. | 171 // Otherwise returns a network error code. |
171 int CreateSystemProxyConfigService( | 172 int CreateSystemProxyConfigService( |
172 scoped_ptr<net::ProxyConfigService>* config_service) { | 173 scoped_ptr<net::ProxyConfigService>* config_service) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 400 |
400 // Notify the delegate of completion. | 401 // Notify the delegate of completion. |
401 delegate_->OnCompletedConnectionTestExperiment(current, result); | 402 delegate_->OnCompletedConnectionTestExperiment(current, result); |
402 | 403 |
403 if (remaining_experiments_.empty()) { | 404 if (remaining_experiments_.empty()) { |
404 delegate_->OnCompletedConnectionTestSuite(); | 405 delegate_->OnCompletedConnectionTestSuite(); |
405 } else { | 406 } else { |
406 StartNextExperiment(); | 407 StartNextExperiment(); |
407 } | 408 } |
408 } | 409 } |
OLD | NEW |