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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 const Experiment& experiment, | 388 const Experiment& experiment, |
389 scoped_ptr<net::ProxyConfigService>* proxy_config_service, | 389 scoped_ptr<net::ProxyConfigService>* proxy_config_service, |
390 int status) { | 390 int status) { |
391 if (status == net::OK) | 391 if (status == net::OK) |
392 status = request_context_->Init(experiment, proxy_config_service); | 392 status = request_context_->Init(experiment, proxy_config_service); |
393 if (status != net::OK) { | 393 if (status != net::OK) { |
394 tester_->OnExperimentCompleted(status); | 394 tester_->OnExperimentCompleted(status); |
395 return; | 395 return; |
396 } | 396 } |
397 // Fetch a request using the experimental context. | 397 // Fetch a request using the experimental context. |
398 request_.reset(new net::URLRequest(experiment.url, this)); | 398 request_.reset(new net::URLRequest(experiment.url, |
399 request_->set_context(request_context_.get()); | 399 this, |
| 400 request_context_.get())); |
400 request_->Start(); | 401 request_->Start(); |
401 } | 402 } |
402 | 403 |
403 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { | 404 void ConnectionTester::TestRunner::Run(const Experiment& experiment) { |
404 // Try to create a net::URLRequestContext for this experiment. | 405 // Try to create a net::URLRequestContext for this experiment. |
405 request_context_.reset( | 406 request_context_.reset( |
406 new ExperimentURLRequestContext(tester_->proxy_request_context_)); | 407 new ExperimentURLRequestContext(tester_->proxy_request_context_)); |
407 scoped_ptr<net::ProxyConfigService>* proxy_config_service = | 408 scoped_ptr<net::ProxyConfigService>* proxy_config_service = |
408 new scoped_ptr<net::ProxyConfigService>(); | 409 new scoped_ptr<net::ProxyConfigService>(); |
409 base::Callback<void(int)> config_service_callback = | 410 base::Callback<void(int)> config_service_callback = |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 | 516 |
516 // Notify the delegate of completion. | 517 // Notify the delegate of completion. |
517 delegate_->OnCompletedConnectionTestExperiment(current, result); | 518 delegate_->OnCompletedConnectionTestExperiment(current, result); |
518 | 519 |
519 if (remaining_experiments_.empty()) { | 520 if (remaining_experiments_.empty()) { |
520 delegate_->OnCompletedConnectionTestSuite(); | 521 delegate_->OnCompletedConnectionTestSuite(); |
521 } else { | 522 } else { |
522 StartNextExperiment(); | 523 StartNextExperiment(); |
523 } | 524 } |
524 } | 525 } |
OLD | NEW |