Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 238433003: Provide Shill IP Address to myIpAddress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/chromeos.gyp » ('j') | chromeos/network/host_resolver_impl_chromeos.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 net::HostResolverImplChromeOS::CreateSystemResolver(options, net_log);
193 #else
194 global_host_resolver =
195 net::HostResolver::CreateSystemResolver(options, net_log);
196 #endif
190 197
191 // Determine if we should disable IPv6 support. 198 // Determine if we should disable IPv6 support.
192 if (command_line.HasSwitch(switches::kEnableIPv6)) { 199 if (command_line.HasSwitch(switches::kEnableIPv6)) {
193 // Disable IPv6 probing. 200 // Disable IPv6 probing.
194 global_host_resolver->SetDefaultAddressFamily( 201 global_host_resolver->SetDefaultAddressFamily(
195 net::ADDRESS_FAMILY_UNSPECIFIED); 202 net::ADDRESS_FAMILY_UNSPECIFIED);
196 } else if (command_line.HasSwitch(switches::kDisableIPv6)) { 203 } else if (command_line.HasSwitch(switches::kDisableIPv6)) {
197 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4); 204 global_host_resolver->SetDefaultAddressFamily(net::ADDRESS_FAMILY_IPV4);
198 } 205 }
199 206
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 std::string version_flag = 1212 std::string version_flag =
1206 command_line.GetSwitchValueASCII(switches::kQuicVersion); 1213 command_line.GetSwitchValueASCII(switches::kQuicVersion);
1207 for (size_t i = 0; i < supported_versions.size(); ++i) { 1214 for (size_t i = 0; i < supported_versions.size(); ++i) {
1208 net::QuicVersion version = supported_versions[i]; 1215 net::QuicVersion version = supported_versions[i];
1209 if (net::QuicVersionToString(version) == version_flag) { 1216 if (net::QuicVersionToString(version) == version_flag) {
1210 return version; 1217 return version;
1211 } 1218 }
1212 } 1219 }
1213 return net::QUIC_VERSION_UNSUPPORTED; 1220 return net::QUIC_VERSION_UNSUPPORTED;
1214 } 1221 }
OLDNEW
« no previous file with comments | « no previous file | chromeos/chromeos.gyp » ('j') | chromeos/network/host_resolver_impl_chromeos.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698