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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 920 should_restart_with_blocking_dns_ = true; | 920 should_restart_with_blocking_dns_ = true; |
| 921 } | 921 } |
| 922 | 922 |
| 923 bool ProxyResolverV8Tracing::Job::GetDnsFromLocalCache( | 923 bool ProxyResolverV8Tracing::Job::GetDnsFromLocalCache( |
| 924 const std::string& host, | 924 const std::string& host, |
| 925 ResolveDnsOperation op, | 925 ResolveDnsOperation op, |
| 926 std::string* output, | 926 std::string* output, |
| 927 bool* return_value) { | 927 bool* return_value) { |
| 928 CheckIsOnWorkerThread(); | 928 CheckIsOnWorkerThread(); |
| 929 | 929 |
| 930 if (op == MY_IP_ADDRESS || op == MY_IP_ADDRESS_EX) { | |
|
eroman
2014/04/21 22:54:47
There is a difference between MY_IP_ADDRESS and MY
stevenjb
2014/04/22 22:32:56
Currently we only have ipv4 address available. I w
| |
| 931 // If a system (e.g. Chrome OS) has specified an explicit IP address to | |
| 932 // use, return that. | |
| 933 std::string my_ip_address = host_resolver()->my_ip_address(); | |
|
eroman
2014/04/21 22:54:47
This is not correct. The HostResolver should only
stevenjb
2014/04/22 22:32:56
Ah, you are right. I will move this to DoDnsOperat
| |
| 934 if (!my_ip_address.empty()) { | |
| 935 *output = my_ip_address; | |
| 936 *return_value = true; | |
| 937 return true; | |
| 938 } | |
| 939 } | |
| 940 | |
| 930 DnsCache::const_iterator it = dns_cache_.find(MakeDnsCacheKey(host, op)); | 941 DnsCache::const_iterator it = dns_cache_.find(MakeDnsCacheKey(host, op)); |
| 931 if (it == dns_cache_.end()) | 942 if (it == dns_cache_.end()) |
| 932 return false; | 943 return false; |
| 933 | 944 |
| 934 *output = it->second; | 945 *output = it->second; |
| 935 *return_value = !it->second.empty(); | 946 *return_value = !it->second.empty(); |
| 936 return true; | 947 return true; |
| 937 } | 948 } |
| 938 | 949 |
| 939 void ProxyResolverV8Tracing::Job::SaveDnsToLocalCache( | 950 void ProxyResolverV8Tracing::Job::SaveDnsToLocalCache( |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 DCHECK(!set_pac_script_job_.get()); | 1175 DCHECK(!set_pac_script_job_.get()); |
| 1165 CHECK_EQ(0, num_outstanding_callbacks_); | 1176 CHECK_EQ(0, num_outstanding_callbacks_); |
| 1166 | 1177 |
| 1167 set_pac_script_job_ = new Job(this); | 1178 set_pac_script_job_ = new Job(this); |
| 1168 set_pac_script_job_->StartSetPacScript(script_data, callback); | 1179 set_pac_script_job_->StartSetPacScript(script_data, callback); |
| 1169 | 1180 |
| 1170 return ERR_IO_PENDING; | 1181 return ERR_IO_PENDING; |
| 1171 } | 1182 } |
| 1172 | 1183 |
| 1173 } // namespace net | 1184 } // namespace net |
| OLD | NEW |