diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 09:21:00 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 09:21:00 +0000 |
commit | 106ccd2ccd1ac30217f27541b515c4bb93f10707 (patch) | |
tree | 5e1051f37501d9894d47853529a8b564dd8da614 /net/dns/host_resolver_impl.h | |
parent | ecf56301956369d9fa0f341a0001efe9efbc1cbd (diff) | |
download | chromium_src-106ccd2ccd1ac30217f27541b515c4bb93f10707.zip chromium_src-106ccd2ccd1ac30217f27541b515c4bb93f10707.tar.gz chromium_src-106ccd2ccd1ac30217f27541b515c4bb93f10707.tar.bz2 |
Provide Shill IP Address to myIpAddress()
On Chrome OS we need to get the IP Address to use for myIpAddress() from Shill since gethostname() returns localhost.
BUG=175652
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/238433003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277679 0039d316-1c4b-4281-b951-d872f2087c98
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_; |