Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: chrome/browser/net/connection_tester.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate_unittest.cc ('k') | chrome/browser/net/connection_tester_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698