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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 if (status == net::OK) | 405 if (status == net::OK) |
406 status = request_context_->Init(experiment, | 406 status = request_context_->Init(experiment, |
407 proxy_config_service, | 407 proxy_config_service, |
408 net_log_); | 408 net_log_); |
409 if (status != net::OK) { | 409 if (status != net::OK) { |
410 tester_->OnExperimentCompleted(status); | 410 tester_->OnExperimentCompleted(status); |
411 return; | 411 return; |
412 } | 412 } |
413 // Fetch a request using the experimental context. | 413 // Fetch a request using the experimental context. |
414 request_ = request_context_->CreateRequest( | 414 request_ = request_context_->CreateRequest( |
415 experiment.url, net::DEFAULT_PRIORITY, this, NULL); | 415 experiment.url, net::DEFAULT_PRIORITY, this); |
416 request_->Start(); | 416 request_->Start(); |
417 } | 417 } |
418 | 418 |
419 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { | 419 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { |
420 // Try to create a net::URLRequestContext for this experiment. | 420 // Try to create a net::URLRequestContext for this experiment. |
421 request_context_.reset( | 421 request_context_.reset( |
422 new ExperimentURLRequestContext(tester_->proxy_request_context_)); | 422 new ExperimentURLRequestContext(tester_->proxy_request_context_)); |
423 scoped_ptr<net::ProxyConfigService>* proxy_config_service = | 423 scoped_ptr<net::ProxyConfigService>* proxy_config_service = |
424 new scoped_ptr<net::ProxyConfigService>(); | 424 new scoped_ptr<net::ProxyConfigService>(); |
425 base::Callback<void(int)> config_service_callback = | 425 base::Callback<void(int)> config_service_callback = |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 // Notify the delegate of completion. | 535 // Notify the delegate of completion. |
536 delegate_->OnCompletedConnectionTestExperiment(current, result); | 536 delegate_->OnCompletedConnectionTestExperiment(current, result); |
537 | 537 |
538 if (remaining_experiments_.empty()) { | 538 if (remaining_experiments_.empty()) { |
539 delegate_->OnCompletedConnectionTestSuite(); | 539 delegate_->OnCompletedConnectionTestSuite(); |
540 } else { | 540 } else { |
541 StartNextExperiment(); | 541 StartNextExperiment(); |
542 } | 542 } |
543 } | 543 } |
OLD | NEW |