| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 if (status == net::OK) | 404 if (status == net::OK) |
| 405 status = request_context_->Init(experiment, | 405 status = request_context_->Init(experiment, |
| 406 proxy_config_service, | 406 proxy_config_service, |
| 407 net_log_); | 407 net_log_); |
| 408 if (status != net::OK) { | 408 if (status != net::OK) { |
| 409 tester_->OnExperimentCompleted(status); | 409 tester_->OnExperimentCompleted(status); |
| 410 return; | 410 return; |
| 411 } | 411 } |
| 412 // Fetch a request using the experimental context. | 412 // Fetch a request using the experimental context. |
| 413 request_ = request_context_->CreateRequest( | 413 request_ = request_context_->CreateRequest( |
| 414 experiment.url, net::DEFAULT_PRIORITY, this, NULL); | 414 experiment.url, net::DEFAULT_PRIORITY, this); |
| 415 request_->Start(); | 415 request_->Start(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { | 418 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { |
| 419 // Try to create a net::URLRequestContext for this experiment. | 419 // Try to create a net::URLRequestContext for this experiment. |
| 420 request_context_.reset( | 420 request_context_.reset( |
| 421 new ExperimentURLRequestContext(tester_->proxy_request_context_)); | 421 new ExperimentURLRequestContext(tester_->proxy_request_context_)); |
| 422 scoped_ptr<net::ProxyConfigService>* proxy_config_service = | 422 scoped_ptr<net::ProxyConfigService>* proxy_config_service = |
| 423 new scoped_ptr<net::ProxyConfigService>(); | 423 new scoped_ptr<net::ProxyConfigService>(); |
| 424 base::Callback<void(int)> config_service_callback = | 424 base::Callback<void(int)> config_service_callback = |
| (...skipping 108 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 |