diff options
Diffstat (limited to 'net/dns/host_resolver_impl.h')
-rw-r--r-- | net/dns/host_resolver_impl.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h index 7bcc800..7a0fb57 100644 --- a/net/dns/host_resolver_impl.h +++ b/net/dns/host_resolver_impl.h @@ -16,7 +16,6 @@ #include "base/time/time.h" #include "net/base/net_export.h" #include "net/base/network_change_notifier.h" -#include "net/base/prioritized_dispatcher.h" #include "net/dns/host_cache.h" #include "net/dns/host_resolver.h" #include "net/dns/host_resolver_proc.h" @@ -97,21 +96,17 @@ class NET_EXPORT HostResolverImpl uint32 retry_factor; }; - // Creates a HostResolver that first uses the local cache |cache|, and then - // falls back to |proc_params.resolver_proc|. + // Creates a HostResolver as specified by |options|. // - // If |cache| is NULL, then no caching is used. Otherwise we take - // ownership of the |cache| pointer, and will free it during destruction. + // If Options.enable_caching is true, a cache is created using + // HostCache::CreateDefaultCache(). Otherwise no cache is used. // - // |job_limits| specifies the maximum number of jobs that the resolver will - // run at once. This upper-bounds the total number of outstanding - // DNS transactions (not counting retransmissions and retries). + // Options.GetDispatcherLimits() determines the maximum number of jobs that + // the resolver will run at once. This upper-bounds the total number of + // outstanding DNS transactions (not counting retransmissions and retries). // // |net_log| must remain valid for the life of the HostResolverImpl. - HostResolverImpl(scoped_ptr<HostCache> cache, - const PrioritizedDispatcher::Limits& job_limits, - const ProcTaskParams& proc_params, - NetLog* net_log); + HostResolverImpl(const Options& options, NetLog* net_log); // If any completion callbacks are pending when the resolver is destroyed, // the host resolutions are cancelled, and the completion callbacks will not @@ -145,6 +140,10 @@ class NET_EXPORT HostResolverImpl virtual HostCache* GetHostCache() OVERRIDE; virtual base::Value* GetDnsConfigAsValue() const OVERRIDE; + void set_proc_params_for_test(const ProcTaskParams& proc_params) { + proc_params_ = proc_params; + } + private: friend class HostResolverImplTest; class Job; @@ -237,7 +236,7 @@ class NET_EXPORT HostResolverImpl // HostResolverImpl::Job could occupy multiple PrioritizedDispatcher job // slots. size_t num_running_dispatcher_jobs_for_tests() const { - return dispatcher_.num_running_jobs(); + return dispatcher_->num_running_jobs(); } // Cache of host resolution results. @@ -247,7 +246,7 @@ class NET_EXPORT HostResolverImpl JobMap jobs_; // Starts Jobs according to their priority and the configured limits. - PrioritizedDispatcher dispatcher_; + scoped_ptr<PrioritizedDispatcher> dispatcher_; // Limit on the maximum number of jobs queued in |dispatcher_|. size_t max_queued_jobs_; |