| Index: net/proxy/proxy_list.cc
|
| ===================================================================
|
| --- net/proxy/proxy_list.cc (revision 199490)
|
| +++ net/proxy/proxy_list.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/callback.h"
|
| #include "base/logging.h"
|
| +#include "base/rand_util.h"
|
| #include "base/strings/string_tokenizer.h"
|
| #include "base/time.h"
|
| #include "base/values.h"
|
| @@ -193,11 +194,13 @@
|
|
|
| void ProxyList::UpdateRetryInfoOnFallback(
|
| ProxyRetryInfoMap* proxy_retry_info, const BoundNetLog& net_log) const {
|
| - // Number of minutes to wait before retrying a bad proxy server.
|
| + // Time to wait before retrying a bad proxy server.
|
| #if defined(OS_ANDROID)
|
| - const TimeDelta kProxyRetryDelay = TimeDelta::FromMinutes(1);
|
| + // Randomize the timeout over a range from one to five minutes.
|
| + const TimeDelta proxy_retry_delay =
|
| + TimeDelta::FromMilliseconds(base::RandInt(1 * 60 * 1000, 5 * 60 * 1000));
|
| #else
|
| - const TimeDelta kProxyRetryDelay = TimeDelta::FromMinutes(5);
|
| + const TimeDelta proxy_retry_delay = TimeDelta::FromMinutes(5);
|
| #endif
|
|
|
| if (proxies_.empty()) {
|
| @@ -215,7 +218,7 @@
|
| iter->second.bad_until = TimeTicks::Now() + iter->second.current_delay;
|
| } else {
|
| ProxyRetryInfo retry_info;
|
| - retry_info.current_delay = kProxyRetryDelay;
|
| + retry_info.current_delay = proxy_retry_delay;
|
| retry_info.bad_until = TimeTicks().Now() + retry_info.current_delay;
|
| (*proxy_retry_info)[key] = retry_info;
|
| }
|
|
|