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