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

Unified Diff: net/proxy/proxy_config_service_android.cc

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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_config_service_android.cc
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 70c639ed6687b375bd24c77807554fe45e51189b..aa8b1bb771af8791f74f8eab44c1d24f29afae16 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -124,21 +124,22 @@ bool GetProxyRules(const GetPropertyCallback& get_property,
// On the opposite, Java spec suggests to use HTTPS port (443) by default (the
// default value of https.proxyPort).
rules->type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME;
- rules->proxy_for_http = LookupProxy("http", get_property,
- ProxyServer::SCHEME_HTTP);
- rules->proxy_for_https = LookupProxy("https", get_property,
- ProxyServer::SCHEME_HTTP);
- rules->proxy_for_ftp = LookupProxy("ftp", get_property,
- ProxyServer::SCHEME_HTTP);
- rules->fallback_proxy = LookupSocksProxy(get_property);
+ rules->proxies_for_http.SetSingleProxyServer(
+ LookupProxy("http", get_property, ProxyServer::SCHEME_HTTP));
+ rules->proxies_for_https.SetSingleProxyServer(
+ LookupProxy("https", get_property, ProxyServer::SCHEME_HTTP));
+ rules->proxies_for_ftp.SetSingleProxyServer(
+ LookupProxy("ftp", get_property, ProxyServer::SCHEME_HTTP));
+ rules->fallback_proxies.SetSingleProxyServer(LookupSocksProxy(get_property);
rules->bypass_rules.Clear();
AddBypassRules("ftp", get_property, &rules->bypass_rules);
AddBypassRules("http", get_property, &rules->bypass_rules);
AddBypassRules("https", get_property, &rules->bypass_rules);
- return rules->proxy_for_http.is_valid() ||
- rules->proxy_for_https.is_valid() ||
- rules->proxy_for_ftp.is_valid() ||
- rules->fallback_proxy.is_valid();
+ // We know a proxy was found if not all of the proxy lists are empty.
+ return !(rules->proxies_for_http.IsEmpty() &&
+ rules->proxies_for_https.IsEmpty() &&
+ rules->proxies_for_ftp.IsEmpty() &&
+ rules->fallback_proxies.IsEmpty());
};
void GetLatestProxyConfigInternal(const GetPropertyCallback& get_property,

Powered by Google App Engine
This is Rietveld 408576698