Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1563)

Unified Diff: net/proxy/proxy_list.cc

Issue 473513002: Keep track of network error in ProxyRetryInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge to head. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/proxy/proxy_list.cc
diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc
index 2adea29fba2cfca8edd04ca334f6bb1a315aab23..f88200bfbbac9ec7db1ed9bab3af95b0f2377367 100644
--- a/net/proxy/proxy_list.cc
+++ b/net/proxy/proxy_list.cc
@@ -146,6 +146,7 @@ base::ListValue* ProxyList::ToValue() const {
}
bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info,
+ const int net_error,
Ryan Sleevi 2014/08/15 00:02:23 noconst
Not at Google. Contact bengr 2014/08/15 17:26:59 Done.
const BoundNetLog& net_log) {
// TODO(eroman): It would be good if instead of removing failed proxies
@@ -171,6 +172,7 @@ bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info,
TimeDelta::FromMinutes(5),
true,
ProxyServer(),
+ net_error,
net_log);
// Remove this proxy from our list.
@@ -182,6 +184,7 @@ void ProxyList::AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info,
base::TimeDelta retry_delay,
bool try_while_bad,
const ProxyServer& proxy_to_retry,
+ const int net_error,
Ryan Sleevi 2014/08/15 00:02:23 noconst
Not at Google. Contact bengr 2014/08/15 17:26:59 Done.
const BoundNetLog& net_log) const {
// Mark this proxy as bad.
std::string proxy_key = proxy_to_retry.ToURI();
@@ -195,6 +198,7 @@ void ProxyList::AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info,
retry_info.current_delay = retry_delay;
retry_info.bad_until = TimeTicks().Now() + retry_info.current_delay;
retry_info.try_while_bad = try_while_bad;
+ retry_info.net_error = net_error;
(*proxy_retry_info)[proxy_key] = retry_info;
}
net_log.AddEvent(NetLog::TYPE_PROXY_LIST_FALLBACK,
@@ -206,6 +210,7 @@ void ProxyList::UpdateRetryInfoOnFallback(
base::TimeDelta retry_delay,
bool reconsider,
const ProxyServer& another_proxy_to_bypass,
+ const int net_error,
Ryan Sleevi 2014/08/15 00:02:23 noconst
Not at Google. Contact bengr 2014/08/15 17:26:59 Done.
const BoundNetLog& net_log) const {
DCHECK(retry_delay != base::TimeDelta());
@@ -215,14 +220,22 @@ void ProxyList::UpdateRetryInfoOnFallback(
}
if (!proxies_[0].is_direct()) {
- AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, proxies_[0],
+ AddProxyToRetryList(proxy_retry_info,
+ retry_delay,
+ reconsider,
+ proxies_[0],
+ net_error,
net_log);
// If an additional proxy to bypass is specified, add it to the retry map
// as well.
if (another_proxy_to_bypass.is_valid()) {
- AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider,
- another_proxy_to_bypass, net_log);
+ AddProxyToRetryList(proxy_retry_info,
+ retry_delay,
+ reconsider,
+ another_proxy_to_bypass,
+ net_error,
+ net_log);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698