| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_HOST_RESOLVER_H_ | 5 #ifndef NET_DNS_HOST_RESOLVER_H_ |
| 6 #define NET_DNS_HOST_RESOLVER_H_ | 6 #define NET_DNS_HOST_RESOLVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void set_host_resolver_flags(HostResolverFlags host_resolver_flags) { | 81 void set_host_resolver_flags(HostResolverFlags host_resolver_flags) { |
| 82 host_resolver_flags_ = host_resolver_flags; | 82 host_resolver_flags_ = host_resolver_flags; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool allow_cached_response() const { return allow_cached_response_; } | 85 bool allow_cached_response() const { return allow_cached_response_; } |
| 86 void set_allow_cached_response(bool b) { allow_cached_response_ = b; } | 86 void set_allow_cached_response(bool b) { allow_cached_response_ = b; } |
| 87 | 87 |
| 88 bool is_speculative() const { return is_speculative_; } | 88 bool is_speculative() const { return is_speculative_; } |
| 89 void set_is_speculative(bool b) { is_speculative_ = b; } | 89 void set_is_speculative(bool b) { is_speculative_ = b; } |
| 90 | 90 |
| 91 bool is_my_ip_address() const { return is_my_ip_address_; } |
| 92 void set_is_my_ip_address(bool b) { is_my_ip_address_ = b; } |
| 93 |
| 91 private: | 94 private: |
| 92 // The hostname to resolve, and the port to use in resulting sockaddrs. | 95 // The hostname to resolve, and the port to use in resulting sockaddrs. |
| 93 HostPortPair host_port_pair_; | 96 HostPortPair host_port_pair_; |
| 94 | 97 |
| 95 // The address family to restrict results to. | 98 // The address family to restrict results to. |
| 96 AddressFamily address_family_; | 99 AddressFamily address_family_; |
| 97 | 100 |
| 98 // Flags to use when resolving this request. | 101 // Flags to use when resolving this request. |
| 99 HostResolverFlags host_resolver_flags_; | 102 HostResolverFlags host_resolver_flags_; |
| 100 | 103 |
| 101 // Whether it is ok to return a result from the host cache. | 104 // Whether it is ok to return a result from the host cache. |
| 102 bool allow_cached_response_; | 105 bool allow_cached_response_; |
| 103 | 106 |
| 104 // Whether this request was started by the DNS prefetcher. | 107 // Whether this request was started by the DNS prefetcher. |
| 105 bool is_speculative_; | 108 bool is_speculative_; |
| 109 |
| 110 // Indicates a request for myIpAddress (to differentiate from other requests |
| 111 // for localhost, currently used by Chrome OS). |
| 112 bool is_my_ip_address_; |
| 106 }; | 113 }; |
| 107 | 114 |
| 108 // Opaque type used to cancel a request. | 115 // Opaque type used to cancel a request. |
| 109 typedef void* RequestHandle; | 116 typedef void* RequestHandle; |
| 110 | 117 |
| 111 // Set Options.max_concurrent_resolves to this to select a default level | 118 // Set Options.max_concurrent_resolves to this to select a default level |
| 112 // of concurrency. | 119 // of concurrency. |
| 113 static const size_t kDefaultParallelism = 0; | 120 static const size_t kDefaultParallelism = 0; |
| 114 | 121 |
| 115 // Set Options.max_retry_attempts to this to select a default retry value. | 122 // Set Options.max_retry_attempts to this to select a default retry value. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 protected: | 198 protected: |
| 192 HostResolver(); | 199 HostResolver(); |
| 193 | 200 |
| 194 private: | 201 private: |
| 195 DISALLOW_COPY_AND_ASSIGN(HostResolver); | 202 DISALLOW_COPY_AND_ASSIGN(HostResolver); |
| 196 }; | 203 }; |
| 197 | 204 |
| 198 } // namespace net | 205 } // namespace net |
| 199 | 206 |
| 200 #endif // NET_DNS_HOST_RESOLVER_H_ | 207 #endif // NET_DNS_HOST_RESOLVER_H_ |
| OLD | NEW |