| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/dns/host_resolver_mojo.h" | 5 #include "net/dns/host_resolver_mojo.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const HostCache::Key& key, | 112 const HostCache::Key& key, |
| 113 AddressList* addresses) { | 113 AddressList* addresses) { |
| 114 if (!info.allow_cached_response()) | 114 if (!info.allow_cached_response()) |
| 115 return ERR_DNS_CACHE_MISS; | 115 return ERR_DNS_CACHE_MISS; |
| 116 | 116 |
| 117 const HostCache::Entry* entry = | 117 const HostCache::Entry* entry = |
| 118 host_cache_->Lookup(key, base::TimeTicks::Now()); | 118 host_cache_->Lookup(key, base::TimeTicks::Now()); |
| 119 if (!entry) | 119 if (!entry) |
| 120 return ERR_DNS_CACHE_MISS; | 120 return ERR_DNS_CACHE_MISS; |
| 121 | 121 |
| 122 *addresses = AddressList::CopyWithPort(entry->addrlist, info.port()); | 122 *addresses = AddressList::CopyWithPort(entry->addresses(), info.port()); |
| 123 return entry->error; | 123 return entry->error(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 HostResolverMojo::Job::Job( | 126 HostResolverMojo::Job::Job( |
| 127 const HostCache::Key& key, | 127 const HostCache::Key& key, |
| 128 AddressList* addresses, | 128 AddressList* addresses, |
| 129 const CompletionCallback& callback, | 129 const CompletionCallback& callback, |
| 130 mojo::InterfaceRequest<interfaces::HostResolverRequestClient> request, | 130 mojo::InterfaceRequest<interfaces::HostResolverRequestClient> request, |
| 131 base::WeakPtr<HostCache> host_cache) | 131 base::WeakPtr<HostCache> host_cache) |
| 132 : key_(key), | 132 : key_(key), |
| 133 addresses_(addresses), | 133 addresses_(addresses), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 151 } | 151 } |
| 152 callback_.Run(error); | 152 callback_.Run(error); |
| 153 delete this; | 153 delete this; |
| 154 } | 154 } |
| 155 | 155 |
| 156 void HostResolverMojo::Job::OnConnectionError() { | 156 void HostResolverMojo::Job::OnConnectionError() { |
| 157 ReportResult(ERR_FAILED, interfaces::AddressListPtr()); | 157 ReportResult(ERR_FAILED, interfaces::AddressListPtr()); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace net | 160 } // namespace net |
| OLD | NEW |