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

Side by Side Diff: net/proxy/proxy_resolver_v8_tracing.cc

Issue 355953002: Flag myIpAddress requests for chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« net/base/address_family.h ('K') | « net/base/address_family.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/proxy/proxy_resolver_v8_tracing.h" 5 #include "net/proxy/proxy_resolver_v8_tracing.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 } 962 }
963 963
964 dns_cache_[MakeDnsCacheKey(host, op)] = cache_value; 964 dns_cache_[MakeDnsCacheKey(host, op)] = cache_value;
965 } 965 }
966 966
967 // static 967 // static
968 HostResolver::RequestInfo ProxyResolverV8Tracing::Job::MakeDnsRequestInfo( 968 HostResolver::RequestInfo ProxyResolverV8Tracing::Job::MakeDnsRequestInfo(
969 const std::string& host, ResolveDnsOperation op) { 969 const std::string& host, ResolveDnsOperation op) {
970 HostPortPair host_port = HostPortPair(host, 80); 970 HostPortPair host_port = HostPortPair(host, 80);
971 if (op == MY_IP_ADDRESS || op == MY_IP_ADDRESS_EX) { 971 if (op == MY_IP_ADDRESS || op == MY_IP_ADDRESS_EX) {
972 host_port.set_host(GetHostName()); 972 host_port.set_host(GetHostName());
eroman 2014/06/26 03:13:47 Lets not set the host in the case of trying to res
stevenjb 2014/06/26 03:36:45 That sounds reasonable, but I'd be worried about b
stevenjb 2014/06/26 03:40:35 To be clear: I would like to keep this as simple a
eroman 2014/06/26 19:58:46 ok that's reasonable. How about making set_is_my_i
stevenjb 2014/06/26 22:04:36 I *think* I understand what you are suggesting, bu
973 } 973 }
974 974
975 HostResolver::RequestInfo info(host_port); 975 HostResolver::RequestInfo info(host_port);
976 976 // Flag myIpAddress requests.
977 if (op == MY_IP_ADDRESS || op == MY_IP_ADDRESS_EX) {
978 HostResolverFlags flags =
979 info.host_resolver_flags() | HOST_RESOLVER_MY_IP_ADDRESS;
980 info.set_host_resolver_flags(flags);
981 }
977 // The non-ex flavors are limited to IPv4 results. 982 // The non-ex flavors are limited to IPv4 results.
978 if (op == MY_IP_ADDRESS || op == DNS_RESOLVE) { 983 if (op == MY_IP_ADDRESS || op == DNS_RESOLVE) {
979 info.set_address_family(ADDRESS_FAMILY_IPV4); 984 info.set_address_family(ADDRESS_FAMILY_IPV4);
980 } 985 }
981 986
982 return info; 987 return info;
983 } 988 }
984 989
985 std::string ProxyResolverV8Tracing::Job::MakeDnsCacheKey( 990 std::string ProxyResolverV8Tracing::Job::MakeDnsCacheKey(
986 const std::string& host, ResolveDnsOperation op) { 991 const std::string& host, ResolveDnsOperation op) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 DCHECK(!set_pac_script_job_.get()); 1169 DCHECK(!set_pac_script_job_.get());
1165 CHECK_EQ(0, num_outstanding_callbacks_); 1170 CHECK_EQ(0, num_outstanding_callbacks_);
1166 1171
1167 set_pac_script_job_ = new Job(this); 1172 set_pac_script_job_ = new Job(this);
1168 set_pac_script_job_->StartSetPacScript(script_data, callback); 1173 set_pac_script_job_->StartSetPacScript(script_data, callback);
1169 1174
1170 return ERR_IO_PENDING; 1175 return ERR_IO_PENDING;
1171 } 1176 }
1172 1177
1173 } // namespace net 1178 } // namespace net
OLDNEW
« net/base/address_family.h ('K') | « net/base/address_family.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698