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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK fix Created 6 years, 7 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: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc
index 25cc7e4a701e239f593ca8367bcfcc91c3b3b29c..1201cf0e19838275ccd5640411f073af5c667f40 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc
@@ -18,10 +18,12 @@ DataReductionProxyChromeConfigurator::DataReductionProxyChromeConfigurator(
DataReductionProxyChromeConfigurator::~DataReductionProxyChromeConfigurator() {
}
-void DataReductionProxyChromeConfigurator::Enable(bool primary_restricted,
- bool fallback_restricted,
- const std::string& primary_origin,
- const std::string& fallback_origin) {
+void DataReductionProxyChromeConfigurator::Enable(
+ bool primary_restricted,
+ bool fallback_restricted,
+ const std::string& primary_origin,
+ const std::string& fallback_origin,
+ const std::string& ssl_origin) {
DCHECK(prefs_);
DictionaryPrefUpdate update(prefs_, prefs::kProxy);
base::DictionaryValue* dict = update.Get();
@@ -49,7 +51,13 @@ void DataReductionProxyChromeConfigurator::Enable(bool primary_restricted,
return;
}
- dict->SetString("server", "http=" + JoinString(proxies, ",") + ",direct://;");
+ std::string trimmed_ssl;
+ base::TrimString(ssl_origin, "/", &trimmed_ssl);
+
+ std::string server = "http=" + JoinString(proxies, ",") + ",direct://;"
+ + (ssl_origin.empty() ? "" : ("https=" + trimmed_ssl + ",direct://;"));
+
+ dict->SetString("server", server);
dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_FIXED_SERVERS));
dict->SetString("bypass_list", JoinString(bypass_rules_, ", "));
}

Powered by Google App Engine
This is Rietveld 408576698