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

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: 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
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 6893de8ce4dbc79f20e8766781c2043ddf600e04..96e327dceefa293509e2ba3f5055e75d179a2ca5 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -95,6 +95,7 @@
#endif
#if defined(OS_ANDROID) || defined(OS_IOS)
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
#endif
@@ -106,6 +107,7 @@
using content::BrowserThread;
#if defined(OS_ANDROID) || defined(OS_IOS)
+using data_reduction_proxy::DataReductionProxyParams;
using data_reduction_proxy::DataReductionProxySettings;
#endif
@@ -595,10 +597,17 @@ void IOThread::InitAsync() {
#endif
globals_->ssl_config_service = GetSSLConfigService();
#if defined(OS_ANDROID) || defined(OS_IOS)
- if (DataReductionProxySettings::IsIncludedInFieldTrialOrFlags()) {
- spdyproxy_auth_origins_ =
- DataReductionProxySettings::GetDataReductionProxies();
- }
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ int drp_flags = DataReductionProxyParams::kFallbackAllowed;
+ if (DataReductionProxyParams::IsIncludedInFieldTrial())
+ drp_flags |= DataReductionProxyParams::kAllowed;
+ if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial())
+ drp_flags |= DataReductionProxyParams::kAlternativeAllowed;
+ if (DataReductionProxyParams::IsIncludedInPromoFieldTrial())
+ drp_flags |= DataReductionProxyParams::kPromoAllowed;
+ globals_->data_reduction_proxy_params.reset(
+ new DataReductionProxyParams(drp_flags));
+#endif // defined(SPDY_PROXY_AUTH_ORIGIN)
#endif // defined(OS_ANDROID) || defined(OS_IOS)
globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
globals_->host_resolver.get()));
@@ -901,11 +910,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()) {
+ 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();
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698