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

Unified Diff: chrome/browser/io_thread.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index ae45e0d55c910cbfed61c66a15e92924ae9469c4..edc466beaaa6476ed60ea5fdf2b01f8b99b01ae2 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -98,6 +98,7 @@
#endif
#if defined(OS_ANDROID) || defined(OS_IOS)
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
Lei Zhang 2014/05/21 19:41:28 nit: not really needed since you already included
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
#endif
@@ -108,6 +109,7 @@
using content::BrowserThread;
#if defined(OS_ANDROID) || defined(OS_IOS)
+using data_reduction_proxy::DataReductionProxyParams;
using data_reduction_proxy::DataReductionProxySettings;
#endif
@@ -598,10 +600,12 @@ void IOThread::InitAsync() {
#endif
globals_->ssl_config_service = GetSSLConfigService();
#if defined(OS_ANDROID) || defined(OS_IOS)
- if (DataReductionProxySettings::IsIncludedInFieldTrialOrFlags()) {
- spdyproxy_auth_origins_ =
- DataReductionProxySettings::GetDataReductionProxies();
- }
+ globals_->data_reduction_proxy_params.reset(
+ new DataReductionProxyParams(
+ DataReductionProxyParams::IsIncludedInFieldTrial(),
+ true,
+ DataReductionProxyParams::IsIncludedInAlternativeFieldTrial(),
+ true));
#endif // defined(OS_ANDROID) || defined(OS_IOS)
globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
globals_->host_resolver.get()));
@@ -903,11 +907,15 @@ net::HttpAuthHandlerFactory* IOThread::CreateDefaultAuthHandlerFactory(
resolver, gssapi_library_name_, negotiate_disable_cname_lookup_,
negotiate_enable_port_));
- if (!spdyproxy_auth_origins_.empty()) {
- registry_factory->RegisterSchemeFactory(
- "spdyproxy",
- new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory(
- spdyproxy_auth_origins_));
+ if (globals_->data_reduction_proxy_params.get()) {
Lei Zhang 2014/05/21 19:41:28 Have you considered wrapping this block in an ifde
+ std::vector<GURL> data_reduction_proxies =
+ globals_->data_reduction_proxy_params->GetAllowedProxies();
+ if (!data_reduction_proxies.empty()) {
+ registry_factory->RegisterSchemeFactory(
+ "spdyproxy",
+ new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory(
+ data_reduction_proxies));
+ }
}
return registry_factory.release();

Powered by Google App Engine
This is Rietveld 408576698