| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 class ExperimentURLRequestContext : public net::URLRequestContext { | 52 class ExperimentURLRequestContext : public net::URLRequestContext { |
| 53 public: | 53 public: |
| 54 explicit ExperimentURLRequestContext( | 54 explicit ExperimentURLRequestContext( |
| 55 net::URLRequestContext* proxy_request_context) : | 55 net::URLRequestContext* proxy_request_context) : |
| 56 #if !defined(OS_IOS) | 56 #if !defined(OS_IOS) |
| 57 proxy_request_context_(proxy_request_context), | 57 proxy_request_context_(proxy_request_context), |
| 58 #endif | 58 #endif |
| 59 storage_(this), | 59 storage_(this), |
| 60 weak_factory_(this) {} | 60 weak_factory_(this) {} |
| 61 | 61 |
| 62 virtual ~ExperimentURLRequestContext() {} | 62 virtual ~ExperimentURLRequestContext() { |
| 63 AssertNoURLRequests(); |
| 64 } |
| 63 | 65 |
| 64 // Creates a proxy config service for |experiment|. On success returns net::OK | 66 // Creates a proxy config service for |experiment|. On success returns net::OK |
| 65 // and fills |config_service| with a new pointer. Otherwise returns a network | 67 // and fills |config_service| with a new pointer. Otherwise returns a network |
| 66 // error code. | 68 // error code. |
| 67 int CreateProxyConfigService( | 69 int CreateProxyConfigService( |
| 68 ConnectionTester::ProxySettingsExperiment experiment, | 70 ConnectionTester::ProxySettingsExperiment experiment, |
| 69 scoped_ptr<net::ProxyConfigService>* config_service, | 71 scoped_ptr<net::ProxyConfigService>* config_service, |
| 70 base::Callback<void(int)> callback) { | 72 base::Callback<void(int)> callback) { |
| 71 switch (experiment) { | 73 switch (experiment) { |
| 72 case ConnectionTester::PROXY_EXPERIMENT_USE_SYSTEM_SETTINGS: | 74 case ConnectionTester::PROXY_EXPERIMENT_USE_SYSTEM_SETTINGS: |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 536 |
| 535 // Notify the delegate of completion. | 537 // Notify the delegate of completion. |
| 536 delegate_->OnCompletedConnectionTestExperiment(current, result); | 538 delegate_->OnCompletedConnectionTestExperiment(current, result); |
| 537 | 539 |
| 538 if (remaining_experiments_.empty()) { | 540 if (remaining_experiments_.empty()) { |
| 539 delegate_->OnCompletedConnectionTestSuite(); | 541 delegate_->OnCompletedConnectionTestSuite(); |
| 540 } else { | 542 } else { |
| 541 StartNextExperiment(); | 543 StartNextExperiment(); |
| 542 } | 544 } |
| 543 } | 545 } |
| OLD | NEW |