| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // | 55 // |
| 56 // Whenever we try to resolve the host, we post a delayed task to check if host | 56 // Whenever we try to resolve the host, we post a delayed task to check if host |
| 57 // resolution (OnLookupComplete) is completed or not. If the original attempt | 57 // resolution (OnLookupComplete) is completed or not. If the original attempt |
| 58 // hasn't completed, then we start another attempt for host resolution. We take | 58 // hasn't completed, then we start another attempt for host resolution. We take |
| 59 // the results from the first attempt that finishes and ignore the results from | 59 // the results from the first attempt that finishes and ignore the results from |
| 60 // all other attempts. | 60 // all other attempts. |
| 61 | 61 |
| 62 class NET_EXPORT HostResolverImpl | 62 class NET_EXPORT HostResolverImpl |
| 63 : public HostResolver, | 63 : public HostResolver, |
| 64 NON_EXPORTED_BASE(public base::NonThreadSafe), | 64 NON_EXPORTED_BASE(public base::NonThreadSafe), |
| 65 public NetworkChangeNotifier::IPAddressObserver, | 65 public NetworkChangeNotifier::IPAddressObserver { |
| 66 public NetworkChangeNotifier::DNSObserver { | |
| 67 public: | 66 public: |
| 68 // The index into |job_pools_| for the various job pools. Pools with a higher | 67 // The index into |job_pools_| for the various job pools. Pools with a higher |
| 69 // index have lower priority. | 68 // index have lower priority. |
| 70 // | 69 // |
| 71 // Note: This is currently unused, since there is a single pool | 70 // Note: This is currently unused, since there is a single pool |
| 72 // for all requests. | 71 // for all requests. |
| 73 enum JobPoolIndex { | 72 enum JobPoolIndex { |
| 74 POOL_NORMAL = 0, | 73 POOL_NORMAL = 0, |
| 75 POOL_COUNT, | 74 POOL_COUNT, |
| 76 }; | 75 }; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 297 } |
| 299 | 298 |
| 300 // Helper methods to get and set retry_factor_. | 299 // Helper methods to get and set retry_factor_. |
| 301 uint32 retry_factor() const { | 300 uint32 retry_factor() const { |
| 302 return retry_factor_; | 301 return retry_factor_; |
| 303 } | 302 } |
| 304 void set_retry_factor(const uint32 retry_factor) { | 303 void set_retry_factor(const uint32 retry_factor) { |
| 305 retry_factor_ = retry_factor; | 304 retry_factor_ = retry_factor; |
| 306 } | 305 } |
| 307 | 306 |
| 308 // NetworkChangeNotifier::OnDNSChanged methods: | |
| 309 virtual void OnDNSChanged(); | |
| 310 | |
| 311 // Cache of host resolution results. | 307 // Cache of host resolution results. |
| 312 scoped_ptr<HostCache> cache_; | 308 scoped_ptr<HostCache> cache_; |
| 313 | 309 |
| 314 // Map from hostname to outstanding job. | 310 // Map from hostname to outstanding job. |
| 315 JobMap jobs_; | 311 JobMap jobs_; |
| 316 | 312 |
| 317 // Maximum number of concurrent jobs allowed, across all pools. Each job may | 313 // Maximum number of concurrent jobs allowed, across all pools. Each job may |
| 318 // create multiple concurrent resolve attempts for the hostname. | 314 // create multiple concurrent resolve attempts for the hostname. |
| 319 size_t max_jobs_; | 315 size_t max_jobs_; |
| 320 | 316 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 HostResolverFlags additional_resolver_flags_; | 364 HostResolverFlags additional_resolver_flags_; |
| 369 | 365 |
| 370 NetLog* net_log_; | 366 NetLog* net_log_; |
| 371 | 367 |
| 372 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); | 368 DISALLOW_COPY_AND_ASSIGN(HostResolverImpl); |
| 373 }; | 369 }; |
| 374 | 370 |
| 375 } // namespace net | 371 } // namespace net |
| 376 | 372 |
| 377 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ | 373 #endif // NET_BASE_HOST_RESOLVER_IMPL_H_ |
| OLD | NEW |