OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_HOST_RESOLVER_IMPL_H_ | 5 #ifndef NET_BASE_HOST_RESOLVER_IMPL_H_ |
6 #define NET_BASE_HOST_RESOLVER_IMPL_H_ | 6 #define NET_BASE_HOST_RESOLVER_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 class Job; | 162 class Job; |
163 class JobPool; | 163 class JobPool; |
164 class IPv6ProbeJob; | 164 class IPv6ProbeJob; |
165 class Request; | 165 class Request; |
166 typedef std::vector<Request*> RequestsList; | 166 typedef std::vector<Request*> RequestsList; |
167 typedef HostCache::Key Key; | 167 typedef HostCache::Key Key; |
168 typedef std::map<Key, scoped_refptr<Job> > JobMap; | 168 typedef std::map<Key, scoped_refptr<Job> > JobMap; |
169 typedef std::vector<HostResolver::Observer*> ObserversList; | 169 typedef std::vector<HostResolver::Observer*> ObserversList; |
170 | 170 |
171 // Helper used by |Resolve()| and |ResolveFromCache()|. Performs IP | 171 // Helper used by |Resolve()| and |ResolveFromCache()|. Performs IP |
172 // literal and cache lookup, returns OK if successfull, | 172 // literal and cache lookup, returns OK if successful, |
173 // ERR_NAME_NOT_RESOLVED if either hostname is invalid or IP literal is | 173 // ERR_NAME_NOT_RESOLVED if either hostname is invalid or IP literal is |
174 // incompatible, ERR_DNS_CACHE_MISS if entry was not found in cache. | 174 // incompatible, ERR_DNS_CACHE_MISS if entry was not found in cache. |
175 int ResolveHelper(int request_id, | 175 int ResolveHelper(int request_id, |
176 const Key& key, | 176 const Key& key, |
177 const RequestInfo& info, | 177 const RequestInfo& info, |
178 AddressList* addresses, | 178 AddressList* addresses, |
179 const BoundNetLog& request_net_log, | 179 const BoundNetLog& request_net_log); |
180 const BoundNetLog& source_net_log); | |
181 | 180 |
182 // Tries to resolve |key| as an IP, returns true and sets |net_error| if | 181 // Tries to resolve |key| as an IP, returns true and sets |net_error| if |
183 // succeeds, returns false otherwise. | 182 // succeeds, returns false otherwise. |
184 bool ResolveAsIP(const Key& key, | 183 bool ResolveAsIP(const Key& key, |
185 const RequestInfo& info, | 184 const RequestInfo& info, |
186 int* net_error, | 185 int* net_error, |
187 AddressList* addresses); | 186 AddressList* addresses); |
188 | 187 |
189 // If |key| is not found in cache returns false, otherwise returns | 188 // If |key| is not found in cache returns false, otherwise returns |
190 // true, sets |net_error| to the cached error code and fills |addresses| | 189 // true, sets |net_error| to the cached error code and fills |addresses| |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 HostResolverFlags additional_resolver_flags_; | 367 HostResolverFlags additional_resolver_flags_; |
369 | 368 |
370 NetLog* net_log_; | 369 NetLog* net_log_; |
371 | 370 |
372 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 371 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
373 }; | 372 }; |
374 | 373 |
375 } // namespace net | 374 } // namespace net |
376 | 375 |
377 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ | 376 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ |
OLD | NEW |