| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #endif | 94 #endif |
| 95 | 95 |
| 96 #if defined(OS_ANDROID) || defined(OS_IOS) | 96 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 97 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 97 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
| 98 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 98 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
| 102 #include "chrome/browser/chromeos/login/users/user_manager.h" | 102 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 103 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 103 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 104 #include "chromeos/network/host_resolver_impl_chromeos.h" |
| 104 #endif | 105 #endif |
| 105 | 106 |
| 106 using content::BrowserThread; | 107 using content::BrowserThread; |
| 107 | 108 |
| 108 #if defined(OS_ANDROID) || defined(OS_IOS) | 109 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 109 using data_reduction_proxy::DataReductionProxyParams; | 110 using data_reduction_proxy::DataReductionProxyParams; |
| 110 using data_reduction_proxy::DataReductionProxySettings; | 111 using data_reduction_proxy::DataReductionProxySettings; |
| 111 #endif | 112 #endif |
| 112 | 113 |
| 113 class SafeBrowsingURLRequestContext; | 114 class SafeBrowsingURLRequestContext; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 command_line.GetSwitchValueASCII(switches::kHostResolverRetryAttempts); | 179 command_line.GetSwitchValueASCII(switches::kHostResolverRetryAttempts); |
| 179 // Parse the switch (it should be a non-negative integer). | 180 // Parse the switch (it should be a non-negative integer). |
| 180 int n; | 181 int n; |
| 181 if (base::StringToInt(s, &n) && n >= 0) { | 182 if (base::StringToInt(s, &n) && n >= 0) { |
| 182 options.max_retry_attempts = static_cast<size_t>(n); | 183 options.max_retry_attempts = static_cast<size_t>(n); |
| 183 } else { | 184 } else { |
| 184 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; | 185 LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; |
| 185 } | 186 } |
| 186 } | 187 } |
| 187 | 188 |
| 188 scoped_ptr<net::HostResolver> global_host_resolver( | 189 scoped_ptr<net::HostResolver> global_host_resolver; |
| 189 net::HostResolver::CreateSystemResolver(options, net_log)); | 190 #if defined OS_CHROMEOS |
| 191 global_host_resolver = |
| 192 chromeos::HostResolverImplChromeOS::CreateSystemResolver(options, |
| 193 net_log); |
| 194 #else |
| 195 global_host_resolver = |
| 196 net::HostResolver::CreateSystemResolver(options, net_log); |
| 197 #endif |
| 190 | 198 |
| 191 // Determine if we should disable IPv6 support. | 199 // Determine if we should disable IPv6 support. |
| 192 if (command_line.HasSwitch(switches::kEnableIPv6)) { | 200 if (command_line.HasSwitch(switches::kEnableIPv6)) { |
| 193 // Disable IPv6 probing. | 201 // Disable IPv6 probing. |
| 194 global_host_resolver->SetDefaultAddressFamily( | 202 global_host_resolver->SetDefaultAddressFamily( |
| 195 net::ADDRESS_FAMILY_UNSPECIFIED); | 203 net::ADDRESS_FAMILY_UNSPECIFIED); |
| 196 } else if (command_line.HasSwitch(switches::kDisableIPv6)) { | 204 } else if (command_line.HasSwitch(switches::kDisableIPv6)) { |
| 197 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); | 205 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); |
| 198 } | 206 } |
| 199 | 207 |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 std::string version_flag = | 1225 std::string version_flag = |
| 1218 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1226 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
| 1219 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1227 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1220 net::QuicVersion version = supported_versions[i]; | 1228 net::QuicVersion version = supported_versions[i]; |
| 1221 if (net::QuicVersionToString(version) == version_flag) { | 1229 if (net::QuicVersionToString(version) == version_flag) { |
| 1222 return version; | 1230 return version; |
| 1223 } | 1231 } |
| 1224 } | 1232 } |
| 1225 return net::QUIC_VERSION_UNSUPPORTED; | 1233 return net::QUIC_VERSION_UNSUPPORTED; |
| 1226 } | 1234 } |
| OLD | NEW |