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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 net::URLRequest* request) { | 381 net::URLRequest* request) { |
382 int result = net::OK; | 382 int result = net::OK; |
383 if (!request->status().is_success()) { | 383 if (!request->status().is_success()) { |
384 DCHECK_NE(net::ERR_IO_PENDING, request->status().error()); | 384 DCHECK_NE(net::ERR_IO_PENDING, request->status().error()); |
385 result = request->status().error(); | 385 result = request->status().error(); |
386 } | 386 } |
387 | 387 |
388 // Post a task to notify the parent rather than handling it right away, | 388 // Post a task to notify the parent rather than handling it right away, |
389 // to avoid re-entrancy problems with URLRequest. (Don't want the caller | 389 // to avoid re-entrancy problems with URLRequest. (Don't want the caller |
390 // to end up deleting the URLRequest while in the middle of processing). | 390 // to end up deleting the URLRequest while in the middle of processing). |
391 MessageLoop::current()->PostTask( | 391 base::MessageLoop::current()->PostTask( |
392 FROM_HERE, | 392 FROM_HERE, |
393 base::Bind(&TestRunner::OnExperimentCompletedWithResult, | 393 base::Bind(&TestRunner::OnExperimentCompletedWithResult, |
394 weak_factory_.GetWeakPtr(), result)); | 394 weak_factory_.GetWeakPtr(), result)); |
395 } | 395 } |
396 | 396 |
397 void ConnectionTester::TestRunner::OnExperimentCompletedWithResult(int result) { | 397 void ConnectionTester::TestRunner::OnExperimentCompletedWithResult(int result) { |
398 tester_->OnExperimentCompleted(result); | 398 tester_->OnExperimentCompleted(result); |
399 } | 399 } |
400 | 400 |
401 void ConnectionTester::TestRunner::ProxyConfigServiceCreated( | 401 void ConnectionTester::TestRunner::ProxyConfigServiceCreated( |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 // Notify the delegate of completion. | 534 // Notify the delegate of completion. |
535 delegate_->OnCompletedConnectionTestExperiment(current, result); | 535 delegate_->OnCompletedConnectionTestExperiment(current, result); |
536 | 536 |
537 if (remaining_experiments_.empty()) { | 537 if (remaining_experiments_.empty()) { |
538 delegate_->OnCompletedConnectionTestSuite(); | 538 delegate_->OnCompletedConnectionTestSuite(); |
539 } else { | 539 } else { |
540 StartNextExperiment(); | 540 StartNextExperiment(); |
541 } | 541 } |
542 } | 542 } |
OLD | NEW |