diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 00:24:08 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 00:24:08 +0000 |
commit | 81a98cdd9ce1bb7d8e893d194e09abfd68024858 (patch) | |
tree | 986b726f3c9d016df340ae13ba0fa93a51a9b9ce /net/base/host_resolver_impl.h | |
parent | bb5310b61786423453cf8580c4287b8f1bf7194f (diff) | |
download | chromium_src-81a98cdd9ce1bb7d8e893d194e09abfd68024858.zip chromium_src-81a98cdd9ce1bb7d8e893d194e09abfd68024858.tar.gz chromium_src-81a98cdd9ce1bb7d8e893d194e09abfd68024858.tar.bz2 |
Add a command line option ("host-resolver-retry-attempts")
to specify the number of retry attempts to resolve host.
BUG=82580
TEST=host resolver unit tests
R=eroman
Review URL: http://codereview.chromium.org/7011044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver_impl.h')
-rw-r--r-- | net/base/host_resolver_impl.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/net/base/host_resolver_impl.h b/net/base/host_resolver_impl.h index 9b8c1a6..19b4a2e 100644 --- a/net/base/host_resolver_impl.h +++ b/net/base/host_resolver_impl.h @@ -87,19 +87,22 @@ class NET_API HostResolverImpl // |max_jobs| specifies the maximum number of threads that the host resolver // will use (not counting potential duplicate attempts). Use // SetPoolConstraints() to specify finer-grain settings. + // |max_retry_attempts| is the maximum number of times we will retry for host + // resolution. Pass HostResolver::kDefaultRetryAttempts to choose a default + // value. // // For each attempt, we could start another attempt if host is not resolved // within unresponsive_delay_ time. We keep attempting to resolve the host - // until retry interval reaches maximum_unresponsive_delay_ time. For every - // retry attempt, we grow the unresponsive_delay_ by the retry_factor_ amount - // (that is retry interval is multiplied by the retry factor each time). Once - // retry interval exceeds maximum_unresponsive_delay_ time, we give up on - // additional attempts. + // for max_retry_attempts. For every retry attempt, we grow the + // unresponsive_delay_ by the retry_factor_ amount (that is retry interval is + // multiplied by the retry factor each time). Once we have retried + // max_retry_attempts, we give up on additional attempts. // // |net_log| must remain valid for the life of the HostResolverImpl. HostResolverImpl(HostResolverProc* resolver_proc, HostCache* cache, size_t max_jobs, + size_t max_retry_attempts, NetLog* net_log); // If any completion callbacks are pending when the resolver is destroyed, @@ -252,13 +255,21 @@ class NET_API HostResolverImpl // NetworkChangeNotifier::IPAddressObserver methods: virtual void OnIPAddressChanged(); + // Helper methods to get and set max_retry_attempts_. + size_t max_retry_attempts() const { + return max_retry_attempts_; + } + void set_max_retry_attempts(const size_t max_retry_attempts) { + max_retry_attempts_ = max_retry_attempts; + } + // Helper methods for unit tests to get and set unresponsive_delay_. base::TimeDelta unresponsive_delay() const { return unresponsive_delay_; } void set_unresponsive_delay(const base::TimeDelta& unresponsive_delay) { unresponsive_delay_ = unresponsive_delay; } - // Helper methods to get and set retry_factor. + // Helper methods to get and set retry_factor_. uint32 retry_factor() const { return retry_factor_; } @@ -266,15 +277,6 @@ class NET_API HostResolverImpl retry_factor_ = retry_factor; } - // Helper methods for unit tests to get and set maximum_unresponsive_delay_. - base::TimeDelta maximum_unresponsive_delay() const { - return maximum_unresponsive_delay_; - } - void set_maximum_unresponsive_delay( - const base::TimeDelta& maximum_unresponsive_delay) { - maximum_unresponsive_delay_ = maximum_unresponsive_delay; - } - // Cache of host resolution results. scoped_ptr<HostCache> cache_; @@ -285,6 +287,9 @@ class NET_API HostResolverImpl // create multiple concurrent resolve attempts for the hostname. size_t max_jobs_; + // Maximum number retry attempts to resolve the hostname. + size_t max_retry_attempts_; + // This is the limit after which we make another attempt to resolve the host // if the worker thread has not responded yet. Allow unit tests to change the // value. @@ -294,11 +299,6 @@ class NET_API HostResolverImpl // change the value. uint32 retry_factor_; - // This is the limit on how large we grow the retry interval. Once it exceeds - // this, we give up on additional attempts. Allow unit tests to change the - // value. - base::TimeDelta maximum_unresponsive_delay_; - // The information to track pending requests for a JobPool, as well as // how many outstanding jobs the pool already has, and its constraints. JobPool* job_pools_[POOL_COUNT]; |