| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 private: | 75 private: |
| 76 // Creates a host resolver for |experiment|. On success returns net::OK and | 76 // Creates a host resolver for |experiment|. On success returns net::OK and |
| 77 // fills |host_resolver| with a new pointer. Otherwise returns a network | 77 // fills |host_resolver| with a new pointer. Otherwise returns a network |
| 78 // error code. | 78 // error code. |
| 79 int CreateHostResolver( | 79 int CreateHostResolver( |
| 80 ConnectionTester::HostResolverExperiment experiment, | 80 ConnectionTester::HostResolverExperiment experiment, |
| 81 scoped_refptr<net::HostResolver>* host_resolver) { | 81 scoped_refptr<net::HostResolver>* host_resolver) { |
| 82 // Create a vanilla HostResolver that disables caching. | 82 // Create a vanilla HostResolver that disables caching. |
| 83 const size_t kMaxJobs = 50u; | 83 const size_t kMaxJobs = 50u; |
| 84 scoped_refptr<net::HostResolverImpl> impl = | 84 scoped_refptr<net::HostResolverImpl> impl = |
| 85 new net::HostResolverImpl(NULL, NULL, kMaxJobs); | 85 new net::HostResolverImpl(NULL, NULL, kMaxJobs, NULL); |
| 86 | 86 |
| 87 *host_resolver = impl; | 87 *host_resolver = impl; |
| 88 | 88 |
| 89 // Modify it slightly based on the experiment being run. | 89 // Modify it slightly based on the experiment being run. |
| 90 switch (experiment) { | 90 switch (experiment) { |
| 91 case ConnectionTester::HOST_RESOLVER_EXPERIMENT_PLAIN: | 91 case ConnectionTester::HOST_RESOLVER_EXPERIMENT_PLAIN: |
| 92 return net::OK; | 92 return net::OK; |
| 93 case ConnectionTester::HOST_RESOLVER_EXPERIMENT_DISABLE_IPV6: | 93 case ConnectionTester::HOST_RESOLVER_EXPERIMENT_DISABLE_IPV6: |
| 94 impl->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | 94 impl->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); |
| 95 return net::OK; | 95 return net::OK; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 392 |
| 393 // Notify the delegate of completion. | 393 // Notify the delegate of completion. |
| 394 delegate_->OnCompletedConnectionTestExperiment(current, result); | 394 delegate_->OnCompletedConnectionTestExperiment(current, result); |
| 395 | 395 |
| 396 if (remaining_experiments_.empty()) { | 396 if (remaining_experiments_.empty()) { |
| 397 delegate_->OnCompletedConnectionTestSuite(); | 397 delegate_->OnCompletedConnectionTestSuite(); |
| 398 } else { | 398 } else { |
| 399 StartNextExperiment(); | 399 StartNextExperiment(); |
| 400 } | 400 } |
| 401 } | 401 } |
| OLD | NEW |