| 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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 options.max_retry_attempts = static_cast<size_t>(n); | 155 options.max_retry_attempts = static_cast<size_t>(n); |
| 156 } else { | 156 } else { |
| 157 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; | 157 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 scoped_ptr<net::HostResolver> global_host_resolver( | 161 scoped_ptr<net::HostResolver> global_host_resolver( |
| 162 net::HostResolver::CreateSystemResolver(options, net_log)); | 162 net::HostResolver::CreateSystemResolver(options, net_log)); |
| 163 | 163 |
| 164 // Determine if we should disable IPv6 support. | 164 // Determine if we should disable IPv6 support. |
| 165 if (!command_line.HasSwitch(switches::kEnableIPv6)) { | 165 if (!command_line.HasSwitch(switches::kEnableIPv6) && |
| 166 if (command_line.HasSwitch(switches::kDisableIPv6)) { | 166 command_line.HasSwitch(switches::kDisableIPv6)) { |
| 167 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | 167 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); |
| 168 } else { | |
| 169 global_host_resolver->ProbeIPv6Support(); | |
| 170 } | |
| 171 } | 168 } |
| 172 | 169 |
| 173 // If hostname remappings were specified on the command-line, layer these | 170 // If hostname remappings were specified on the command-line, layer these |
| 174 // rules on top of the real host resolver. This allows forwarding all requests | 171 // rules on top of the real host resolver. This allows forwarding all requests |
| 175 // through a designated test server. | 172 // through a designated test server. |
| 176 if (!command_line.HasSwitch(switches::kHostResolverRules)) | 173 if (!command_line.HasSwitch(switches::kHostResolverRules)) |
| 177 return global_host_resolver.PassAs<net::HostResolver>(); | 174 return global_host_resolver.PassAs<net::HostResolver>(); |
| 178 | 175 |
| 179 scoped_ptr<net::MappedHostResolver> remapped_resolver( | 176 scoped_ptr<net::MappedHostResolver> remapped_resolver( |
| 180 new net::MappedHostResolver(global_host_resolver.Pass())); | 177 new net::MappedHostResolver(global_host_resolver.Pass())); |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 base::FieldTrialList::FindFullName(kQuicFieldTrialName); | 957 base::FieldTrialList::FindFullName(kQuicFieldTrialName); |
| 961 | 958 |
| 962 if (command_line.HasSwitch(switches::kDisableQuic)) | 959 if (command_line.HasSwitch(switches::kDisableQuic)) |
| 963 return false; | 960 return false; |
| 964 | 961 |
| 965 if (command_line.HasSwitch(switches::kEnableQuic)) | 962 if (command_line.HasSwitch(switches::kEnableQuic)) |
| 966 return true; | 963 return true; |
| 967 | 964 |
| 968 return quic_trial_group == kQuicFieldTrialEnabledGroupName; | 965 return quic_trial_group == kQuicFieldTrialEnabledGroupName; |
| 969 } | 966 } |
| OLD | NEW |