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/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return net::OK; | 178 return net::OK; |
179 } | 179 } |
180 | 180 |
181 // Creates a proxy service for |experiment|. On success returns net::OK | 181 // Creates a proxy service for |experiment|. On success returns net::OK |
182 // and fills |experiment_proxy_service| with a new pointer. Otherwise returns | 182 // and fills |experiment_proxy_service| with a new pointer. Otherwise returns |
183 // a network error code. | 183 // a network error code. |
184 int CreateProxyService( | 184 int CreateProxyService( |
185 ConnectionTester::ProxySettingsExperiment experiment, | 185 ConnectionTester::ProxySettingsExperiment experiment, |
186 scoped_ptr<net::ProxyConfigService>* proxy_config_service, | 186 scoped_ptr<net::ProxyConfigService>* proxy_config_service, |
187 scoped_ptr<net::ProxyService>* experiment_proxy_service) { | 187 scoped_ptr<net::ProxyService>* experiment_proxy_service) { |
188 if (CommandLine::ForCurrentProcess()->HasSwitch( | 188 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
189 switches::kSingleProcess)) { | 189 switches::kSingleProcess)) { |
190 // We can't create a standard proxy resolver in single-process mode. | 190 // We can't create a standard proxy resolver in single-process mode. |
191 // Rather than falling-back to some other implementation, fail. | 191 // Rather than falling-back to some other implementation, fail. |
192 return net::ERR_NOT_IMPLEMENTED; | 192 return net::ERR_NOT_IMPLEMENTED; |
193 } | 193 } |
194 | 194 |
195 net::DhcpProxyScriptFetcherFactory dhcp_factory; | 195 net::DhcpProxyScriptFetcherFactory dhcp_factory; |
196 | 196 |
197 #if defined(OS_IOS) | 197 #if defined(OS_IOS) |
198 experiment_proxy_service->reset( | 198 experiment_proxy_service->reset( |
199 net::ProxyService::CreateUsingSystemProxyResolver( | 199 net::ProxyService::CreateUsingSystemProxyResolver( |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 // Notify the delegate of completion. | 534 // Notify the delegate of completion. |
535 delegate_->OnCompletedConnectionTestExperiment(current, result); | 535 delegate_->OnCompletedConnectionTestExperiment(current, result); |
536 | 536 |
537 if (remaining_experiments_.empty()) { | 537 if (remaining_experiments_.empty()) { |
538 delegate_->OnCompletedConnectionTestSuite(); | 538 delegate_->OnCompletedConnectionTestSuite(); |
539 } else { | 539 } else { |
540 StartNextExperiment(); | 540 StartNextExperiment(); |
541 } | 541 } |
542 } | 542 } |
OLD | NEW |