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

Unified Diff: net/proxy/proxy_list.h

Issue 473513002: Keep track of network error in ProxyRetryInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor formatting 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
« no previous file with comments | « net/proxy/proxy_info_unittest.cc ('k') | net/proxy/proxy_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_list.h
diff --git a/net/proxy/proxy_list.h b/net/proxy/proxy_list.h
index ac9635a977acbb173d3a1059370159ac071c5dd7..d57743e2df5abd5dd0d57df2326dba7db94b5d95 100644
--- a/net/proxy/proxy_list.h
+++ b/net/proxy/proxy_list.h
@@ -78,10 +78,14 @@ class NET_EXPORT_PRIVATE ProxyList {
// Returns a serialized value for the list. The caller takes ownership of it.
base::ListValue* ToValue() const;
- // Marks the current proxy server as bad and deletes it from the list. The
- // list of known bad proxies is given by proxy_retry_info. Returns true if
- // there is another server available in the list.
+ // Marks the current proxy server as bad and deletes it from the list. The
+ // list of known bad proxies is given by |proxy_retry_info|. |net_error|
+ // should contain the network error encountered when this proxy was tried, if
+ // any. If this fallback is not because of a network error, then |OK| should
+ // be passed in (eg. for reasons such as local policy). Returns true if there
+ // is another server available in the list.
bool Fallback(ProxyRetryInfoMap* proxy_retry_info,
+ int net_error,
const BoundNetLog& net_log);
// Updates |proxy_retry_info| to indicate that the first proxy in the list
@@ -90,22 +94,28 @@ class NET_EXPORT_PRIVATE ProxyList {
// retry after |retry_delay| if positive, and will use the default proxy retry
// duration otherwise. It may reconsider the proxy beforehand if |reconsider|
// is true. Additionally updates |proxy_retry_info| with
- // |another_proxy_to_bypass| if non-empty.
+ // |another_proxy_to_bypass| if non-empty. |net_error| should contain the
+ // network error countered when this proxy was tried, or OK if the proxy retry
+ // info is being updated for a non-network related reason (e.g. local policy).
void UpdateRetryInfoOnFallback(
ProxyRetryInfoMap* proxy_retry_info,
base::TimeDelta retry_delay,
bool reconsider,
const ProxyServer& another_proxy_to_bypass,
+ int net_error,
const BoundNetLog& net_log) const;
private:
// Updates |proxy_retry_info| to indicate that the |proxy_to_retry| in
// |proxies_| is bad for |retry_delay|, but may be reconsidered earlier if
- // |try_while_bad| is true.
+ // |try_while_bad| is true. |net_error| should contain the network error
+ // countered when this proxy was tried, or OK if the proxy retry info is
+ // being updated for a non-network related reason (e.g. local policy).
void AddProxyToRetryList(ProxyRetryInfoMap* proxy_retry_info,
base::TimeDelta retry_delay,
bool try_while_bad,
const ProxyServer& proxy_to_retry,
+ int net_error,
const BoundNetLog& net_log) const;
// List of proxies.
« no previous file with comments | « net/proxy/proxy_info_unittest.cc ('k') | net/proxy/proxy_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698