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