| 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/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 scoped_ptr<net::HostResolver> global_host_resolver; | 190 scoped_ptr<net::HostResolver> global_host_resolver; |
| 191 #if defined OS_CHROMEOS | 191 #if defined OS_CHROMEOS |
| 192 global_host_resolver = | 192 global_host_resolver = |
| 193 chromeos::HostResolverImplChromeOS::CreateSystemResolver(options, | 193 chromeos::HostResolverImplChromeOS::CreateSystemResolver(options, |
| 194 net_log); | 194 net_log); |
| 195 #else | 195 #else |
| 196 global_host_resolver = | 196 global_host_resolver = |
| 197 net::HostResolver::CreateSystemResolver(options, net_log); | 197 net::HostResolver::CreateSystemResolver(options, net_log); |
| 198 #endif | 198 #endif |
| 199 | 199 |
| 200 // Determine if we should disable IPv6 support. | |
| 201 if (command_line.HasSwitch(switches::kEnableIPv6)) { | |
| 202 // Disable IPv6 probing. | |
| 203 global_host_resolver->SetDefaultAddressFamily( | |
| 204 net::ADDRESS_FAMILY_UNSPECIFIED); | |
| 205 } else if (command_line.HasSwitch(switches::kDisableIPv6)) { | |
| 206 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | |
| 207 } | |
| 208 | |
| 209 // If hostname remappings were specified on the command-line, layer these | 200 // If hostname remappings were specified on the command-line, layer these |
| 210 // rules on top of the real host resolver. This allows forwarding all requests | 201 // rules on top of the real host resolver. This allows forwarding all requests |
| 211 // through a designated test server. | 202 // through a designated test server. |
| 212 if (!command_line.HasSwitch(switches::kHostResolverRules)) | 203 if (!command_line.HasSwitch(switches::kHostResolverRules)) |
| 213 return global_host_resolver.Pass(); | 204 return global_host_resolver.Pass(); |
| 214 | 205 |
| 215 scoped_ptr<net::MappedHostResolver> remapped_resolver( | 206 scoped_ptr<net::MappedHostResolver> remapped_resolver( |
| 216 new net::MappedHostResolver(global_host_resolver.Pass())); | 207 new net::MappedHostResolver(global_host_resolver.Pass())); |
| 217 remapped_resolver->SetRulesFromString( | 208 remapped_resolver->SetRulesFromString( |
| 218 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); | 209 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1607 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1617 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1608 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1618 net::QuicVersion version = supported_versions[i]; | 1609 net::QuicVersion version = supported_versions[i]; |
| 1619 if (net::QuicVersionToString(version) == quic_version) { | 1610 if (net::QuicVersionToString(version) == quic_version) { |
| 1620 return version; | 1611 return version; |
| 1621 } | 1612 } |
| 1622 } | 1613 } |
| 1623 | 1614 |
| 1624 return net::QUIC_VERSION_UNSUPPORTED; | 1615 return net::QUIC_VERSION_UNSUPPORTED; |
| 1625 } | 1616 } |
| OLD | NEW |