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_IMPL_H_ | 5 #ifndef NET_DNS_HOST_RESOLVER_IMPL_H_ |
6 #define NET_DNS_HOST_RESOLVER_IMPL_H_ | 6 #define NET_DNS_HOST_RESOLVER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // NetworkChangeNotifier::DNSObserver: | 218 // NetworkChangeNotifier::DNSObserver: |
219 virtual void OnDNSChanged() OVERRIDE; | 219 virtual void OnDNSChanged() OVERRIDE; |
220 | 220 |
221 // True if have a DnsClient with a valid DnsConfig. | 221 // True if have a DnsClient with a valid DnsConfig. |
222 bool HaveDnsConfig() const; | 222 bool HaveDnsConfig() const; |
223 | 223 |
224 // Called when a host name is successfully resolved and DnsTask was run on it | 224 // Called when a host name is successfully resolved and DnsTask was run on it |
225 // and resulted in |net_error|. | 225 // and resulted in |net_error|. |
226 void OnDnsTaskResolve(int net_error); | 226 void OnDnsTaskResolve(int net_error); |
227 | 227 |
228 // Allows the tests to catch slots leaking out of the dispatcher. One | 228 // Allows the tests to catch slots leaking out of the dispatcher. |
229 // HostResolverImpl::Job could occupy multiple PrioritizedDispatcher job | 229 size_t num_running_jobs_for_tests() const { |
230 // slots. | |
231 size_t num_running_dispatcher_jobs_for_tests() const { | |
232 return dispatcher_.num_running_jobs(); | 230 return dispatcher_.num_running_jobs(); |
233 } | 231 } |
234 | 232 |
235 // Cache of host resolution results. | 233 // Cache of host resolution results. |
236 scoped_ptr<HostCache> cache_; | 234 scoped_ptr<HostCache> cache_; |
237 | 235 |
238 // Map from HostCache::Key to a Job. | 236 // Map from HostCache::Key to a Job. |
239 JobMap jobs_; | 237 JobMap jobs_; |
240 | 238 |
241 // Starts Jobs according to their priority and the configured limits. | 239 // Starts Jobs according to their priority and the configured limits. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 277 |
280 // Allow fallback to ProcTask if DnsTask fails. | 278 // Allow fallback to ProcTask if DnsTask fails. |
281 bool fallback_to_proctask_; | 279 bool fallback_to_proctask_; |
282 | 280 |
283 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 281 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
284 }; | 282 }; |
285 | 283 |
286 } // namespace net | 284 } // namespace net |
287 | 285 |
288 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ | 286 #endif // NET_DNS_HOST_RESOLVER_IMPL_H_ |
OLD | NEW |