Index: net/proxy/proxy_info.h |
=================================================================== |
--- net/proxy/proxy_info.h (revision 37149) |
+++ net/proxy/proxy_info.h (working copy) |
@@ -43,9 +43,20 @@ |
} |
// Returns true if this proxy info specifies a direct connection. |
- bool is_direct() const { return proxy_list_.Get().is_direct(); } |
+ bool is_direct() const { |
+ // We don't implicitly fallback to DIRECT unless it was added to the list. |
+ if (is_empty()) |
+ return false; |
+ return proxy_list_.Get().is_direct(); |
+ } |
- // Returns the first valid proxy server. |
+ // Returns true if this proxy info has no proxies left to try. |
+ bool is_empty() const { |
+ return proxy_list_.IsEmpty(); |
+ } |
+ |
+ // Returns the first valid proxy server. is_empty() must be false to be able |
+ // to call this function. |
ProxyServer proxy_server() const { return proxy_list_.Get(); } |
// See description in ProxyList::ToPacString(). |
@@ -57,9 +68,10 @@ |
return proxy_list_.Fallback(proxy_retry_info); |
} |
- // Remove all proxies known to be bad from the proxy list. |
- void RemoveBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { |
- proxy_list_.RemoveBadProxies(proxy_retry_info); |
+ // De-prioritizes the proxies that we have cached as not working, by moving |
+ // them to the end of the proxy list. |
+ void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info) { |
+ proxy_list_.DeprioritizeBadProxies(proxy_retry_info); |
} |
// Delete any entry which doesn't have one of the specified proxy schemes. |
@@ -70,17 +82,12 @@ |
private: |
friend class ProxyService; |
- // If proxy_list_ is set to empty, then a "direct" connection is indicated. |
+ // The ordered list of proxy servers (including DIRECT attempts) remaining to |
+ // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
ProxyList proxy_list_; |
// This value identifies the proxy config used to initialize this object. |
ProxyConfig::ID config_id_; |
- |
- // This flag is false when the proxy configuration was known to be bad when |
- // this proxy info was initialized. In such cases, we know that if this |
- // proxy info does not yield a connection that we might want to reconsider |
- // the proxy config given by config_id_. |
- bool config_was_tried_; |
}; |
} // namespace net |
Property changes on: net\proxy\proxy_info.h |
___________________________________________________________________ |
Modified: svn:mergeinfo |
Merged /trunk/src/net/proxy/proxy_info.h:r34903,34928,35008,35549,36054 |