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

Unified Diff: net/proxy/proxy_info.h

Issue 552164: Merge 34903, 34928, 35008, 35549, 36054 to the 249s branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/249s/src/
Patch Set: Fix some other merge conflicts Created 10 years, 11 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/http/http_network_transaction_unittest.cc ('k') | net/proxy/proxy_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/proxy/proxy_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698