| 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 // Disable IPv6 probing. |
| 167 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | 167 global_host_resolver->SetDefaultAddressFamily( |
| 168 } else { | 168 net::ADDRESS_FAMILY_UNSPECIFIED); |
| 169 global_host_resolver->ProbeIPv6Support(); | 169 } else if (command_line.HasSwitch(switches::kDisableIPv6)) { |
| 170 } | 170 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); |
| 171 } | 171 } |
| 172 | 172 |
| 173 // If hostname remappings were specified on the command-line, layer these | 173 // 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 | 174 // rules on top of the real host resolver. This allows forwarding all requests |
| 175 // through a designated test server. | 175 // through a designated test server. |
| 176 if (!command_line.HasSwitch(switches::kHostResolverRules)) | 176 if (!command_line.HasSwitch(switches::kHostResolverRules)) |
| 177 return global_host_resolver.PassAs<net::HostResolver>(); | 177 return global_host_resolver.PassAs<net::HostResolver>(); |
| 178 | 178 |
| 179 scoped_ptr<net::MappedHostResolver> remapped_resolver( | 179 scoped_ptr<net::MappedHostResolver> remapped_resolver( |
| 180 new net::MappedHostResolver(global_host_resolver.Pass())); | 180 new net::MappedHostResolver(global_host_resolver.Pass())); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 if (command_line.HasSwitch(switches::kDisableQuic)) | 966 if (command_line.HasSwitch(switches::kDisableQuic)) |
| 967 return false; | 967 return false; |
| 968 | 968 |
| 969 if (command_line.HasSwitch(switches::kEnableQuic) || | 969 if (command_line.HasSwitch(switches::kEnableQuic) || |
| 970 command_line.HasSwitch(switches::kEnableQuicHttps)) { | 970 command_line.HasSwitch(switches::kEnableQuicHttps)) { |
| 971 return true; | 971 return true; |
| 972 } | 972 } |
| 973 | 973 |
| 974 return quic_trial_group == kQuicFieldTrialEnabledGroupName; | 974 return quic_trial_group == kQuicFieldTrialEnabledGroupName; |
| 975 } | 975 } |
| OLD | NEW |