Chromium Code Reviews| Index: net/proxy/proxy_list.cc |
| diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc |
| index a3ab02c392a638643fd0b9a06a72cbb77a5bcf69..5330ff48682500909233683f62c71bf3c542dc96 100644 |
| --- a/net/proxy/proxy_list.cc |
| +++ b/net/proxy/proxy_list.cc |
| @@ -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,9 +194,11 @@ bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info, |
| 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 kProxyRetryDelay = |
| + TimeDelta::FromMilliseconds(base::RandInt(1 * 60 * 1000, 5 * 60 * 1000)); |
|
mmenke
2013/05/08 16:50:08
const Blah kBlah is generally only used for values
cbentzel
2013/05/08 16:57:18
proxy_retry_delay?
I don't think the const buys u
mmenke
2013/05/08 16:58:58
The nice thing about the const is that it draws at
bengr
2013/05/08 17:23:11
Yeah, I thought about three ways of writing this:
|
| #else |
| const TimeDelta kProxyRetryDelay = TimeDelta::FromMinutes(5); |
| #endif |