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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 net::URLRequest* request) { | 386 net::URLRequest* request) { |
387 int result = net::OK; | 387 int result = net::OK; |
388 if (!request->status().is_success()) { | 388 if (!request->status().is_success()) { |
389 DCHECK_NE(net::ERR_IO_PENDING, request->status().error()); | 389 DCHECK_NE(net::ERR_IO_PENDING, request->status().error()); |
390 result = request->status().error(); | 390 result = request->status().error(); |
391 } | 391 } |
392 | 392 |
393 // Post a task to notify the parent rather than handling it right away, | 393 // Post a task to notify the parent rather than handling it right away, |
394 // to avoid re-entrancy problems with URLRequest. (Don't want the caller | 394 // to avoid re-entrancy problems with URLRequest. (Don't want the caller |
395 // to end up deleting the URLRequest while in the middle of processing). | 395 // to end up deleting the URLRequest while in the middle of processing). |
396 MessageLoop::current()->PostTask( | 396 base::MessageLoop::current()->PostTask( |
397 FROM_HERE, | 397 FROM_HERE, |
398 base::Bind(&TestRunner::OnExperimentCompletedWithResult, | 398 base::Bind(&TestRunner::OnExperimentCompletedWithResult, |
399 weak_factory_.GetWeakPtr(), result)); | 399 weak_factory_.GetWeakPtr(), |
| 400 result)); |
400 } | 401 } |
401 | 402 |
402 void ConnectionTester::TestRunner::OnExperimentCompletedWithResult(int result) { | 403 void ConnectionTester::TestRunner::OnExperimentCompletedWithResult(int result) { |
403 tester_->OnExperimentCompleted(result); | 404 tester_->OnExperimentCompleted(result); |
404 } | 405 } |
405 | 406 |
406 void ConnectionTester::TestRunner::ProxyConfigServiceCreated( | 407 void ConnectionTester::TestRunner::ProxyConfigServiceCreated( |
407 const Experiment& experiment, | 408 const Experiment& experiment, |
408 scoped_ptr<net::ProxyConfigService>* proxy_config_service, | 409 scoped_ptr<net::ProxyConfigService>* proxy_config_service, |
409 int status) { | 410 int status) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 539 |
539 // Notify the delegate of completion. | 540 // Notify the delegate of completion. |
540 delegate_->OnCompletedConnectionTestExperiment(current, result); | 541 delegate_->OnCompletedConnectionTestExperiment(current, result); |
541 | 542 |
542 if (remaining_experiments_.empty()) { | 543 if (remaining_experiments_.empty()) { |
543 delegate_->OnCompletedConnectionTestSuite(); | 544 delegate_->OnCompletedConnectionTestSuite(); |
544 } else { | 545 } else { |
545 StartNextExperiment(); | 546 StartNextExperiment(); |
546 } | 547 } |
547 } | 548 } |
OLD | NEW |