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

Unified Diff: net/proxy/proxy_config.cc

Issue 710623002: Merge to M39: Correct manual proxy selection for WebSockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
Patch Set: Created 6 years, 1 month 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_config.h ('k') | net/proxy/proxy_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config.cc
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 86c5284d837429b03e201b76b948c172f6ec1c40..71264fd0b67f8c3f77c43c7dcbf35f2f1a3296d7 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -145,6 +145,8 @@ const ProxyList* ProxyConfig::ProxyRules::MapUrlSchemeToProxyList(
MapUrlSchemeToProxyListNoFallback(url_scheme);
if (proxy_server_list && !proxy_server_list->IsEmpty())
return proxy_server_list;
+ if (url_scheme == "ws" || url_scheme == "wss")
+ return GetProxyListForWebSocketScheme();
if (!fallback_proxies.IsEmpty())
return &fallback_proxies;
return NULL; // No mapping for this scheme. Use direct.
@@ -173,6 +175,17 @@ ProxyList* ProxyConfig::ProxyRules::MapUrlSchemeToProxyListNoFallback(
return NULL; // No mapping for this scheme.
}
+const ProxyList* ProxyConfig::ProxyRules::GetProxyListForWebSocketScheme()
+ const {
+ if (!fallback_proxies.IsEmpty())
+ return &fallback_proxies;
+ if (!proxies_for_https.IsEmpty())
+ return &proxies_for_https;
+ if (!proxies_for_http.IsEmpty())
+ return &proxies_for_http;
+ return NULL;
+}
+
ProxyConfig::ProxyConfig()
: auto_detect_(false), pac_mandatory_(false),
source_(PROXY_CONFIG_SOURCE_UNKNOWN), id_(kInvalidConfigID) {
« no previous file with comments | « net/proxy/proxy_config.h ('k') | net/proxy/proxy_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698