Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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()); |
| 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 // TODO: Provide a RequestInfo construction mechanism that does not | |
|
eroman
2014/06/26 22:14:22
TODO(stevnjb):
Note that the name in parens is NO
stevenjb
2014/06/26 22:21:24
Well, actually it says "identifier of the person w
| |
| 979 // require a hostname and sets is_my_ip_address to true instead of this. | |
| 980 info.set_is_my_ip_address(true); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |