| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // after disk access has completed. | 311 // after disk access has completed. |
| 312 void ProxyConfigServiceCreated( | 312 void ProxyConfigServiceCreated( |
| 313 const Experiment& experiment, | 313 const Experiment& experiment, |
| 314 scoped_ptr<net::ProxyConfigService>* proxy_config_service, int status); | 314 scoped_ptr<net::ProxyConfigService>* proxy_config_service, int status); |
| 315 | 315 |
| 316 // Starts running |experiment|. Notifies tester->OnExperimentCompleted() when | 316 // Starts running |experiment|. Notifies tester->OnExperimentCompleted() when |
| 317 // it is done. | 317 // it is done. |
| 318 void Run(const Experiment& experiment); | 318 void Run(const Experiment& experiment); |
| 319 | 319 |
| 320 // Overridden from net::URLRequest::Delegate: | 320 // Overridden from net::URLRequest::Delegate: |
| 321 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 321 virtual void OnResponseStarted(net::URLRequest* request) override; |
| 322 virtual void OnReadCompleted(net::URLRequest* request, | 322 virtual void OnReadCompleted(net::URLRequest* request, |
| 323 int bytes_read) OVERRIDE; | 323 int bytes_read) override; |
| 324 // TODO(eroman): handle cases requiring authentication. | 324 // TODO(eroman): handle cases requiring authentication. |
| 325 | 325 |
| 326 private: | 326 private: |
| 327 // The number of bytes to read each response body chunk. | 327 // The number of bytes to read each response body chunk. |
| 328 static const int kReadBufferSize = 1024; | 328 static const int kReadBufferSize = 1024; |
| 329 | 329 |
| 330 // Starts reading the response's body (and keeps reading until an error or | 330 // Starts reading the response's body (and keeps reading until an error or |
| 331 // end of stream). | 331 // end of stream). |
| 332 void ReadBody(net::URLRequest* request); | 332 void ReadBody(net::URLRequest* request); |
| 333 | 333 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 536 |
| 537 // Notify the delegate of completion. | 537 // Notify the delegate of completion. |
| 538 delegate_->OnCompletedConnectionTestExperiment(current, result); | 538 delegate_->OnCompletedConnectionTestExperiment(current, result); |
| 539 | 539 |
| 540 if (remaining_experiments_.empty()) { | 540 if (remaining_experiments_.empty()) { |
| 541 delegate_->OnCompletedConnectionTestSuite(); | 541 delegate_->OnCompletedConnectionTestSuite(); |
| 542 } else { | 542 } else { |
| 543 StartNextExperiment(); | 543 StartNextExperiment(); |
| 544 } | 544 } |
| 545 } | 545 } |
| OLD | NEW |