| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 int status) { | 394 int status) { |
| 395 if (status == net::OK) | 395 if (status == net::OK) |
| 396 status = request_context_->Init(experiment, | 396 status = request_context_->Init(experiment, |
| 397 proxy_config_service, | 397 proxy_config_service, |
| 398 net_log_); | 398 net_log_); |
| 399 if (status != net::OK) { | 399 if (status != net::OK) { |
| 400 tester_->OnExperimentCompleted(status); | 400 tester_->OnExperimentCompleted(status); |
| 401 return; | 401 return; |
| 402 } | 402 } |
| 403 // Fetch a request using the experimental context. | 403 // Fetch a request using the experimental context. |
| 404 request_.reset(new net::URLRequest(experiment.url, | 404 request_.reset(request_context_->CreateRequest(experiment.url, this)); |
| 405 this, | |
| 406 request_context_.get())); | |
| 407 request_->Start(); | 405 request_->Start(); |
| 408 } | 406 } |
| 409 | 407 |
| 410 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { | 408 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { |
| 411 // Try to create a net::URLRequestContext for this experiment. | 409 // Try to create a net::URLRequestContext for this experiment. |
| 412 request_context_.reset( | 410 request_context_.reset( |
| 413 new ExperimentURLRequestContext(tester_->proxy_request_context_)); | 411 new ExperimentURLRequestContext(tester_->proxy_request_context_)); |
| 414 scoped_ptr<net::ProxyConfigService>* proxy_config_service = | 412 scoped_ptr<net::ProxyConfigService>* proxy_config_service = |
| 415 new scoped_ptr<net::ProxyConfigService>(); | 413 new scoped_ptr<net::ProxyConfigService>(); |
| 416 base::Callback<void(int)> config_service_callback = | 414 base::Callback<void(int)> config_service_callback = |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 523 |
| 526 // Notify the delegate of completion. | 524 // Notify the delegate of completion. |
| 527 delegate_->OnCompletedConnectionTestExperiment(current, result); | 525 delegate_->OnCompletedConnectionTestExperiment(current, result); |
| 528 | 526 |
| 529 if (remaining_experiments_.empty()) { | 527 if (remaining_experiments_.empty()) { |
| 530 delegate_->OnCompletedConnectionTestSuite(); | 528 delegate_->OnCompletedConnectionTestSuite(); |
| 531 } else { | 529 } else { |
| 532 StartNextExperiment(); | 530 StartNextExperiment(); |
| 533 } | 531 } |
| 534 } | 532 } |
| OLD | NEW |