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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
index 7fc8138de326a4baa481d2642762af870fa2470a..5905f96e19b334e250c2f75a94d7a1673d96cc59 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
@@ -87,6 +87,7 @@ DataReductionProxySettings::DataReductionProxySettings(
: restricted_by_carrier_(false),
enabled_by_user_(false),
disabled_on_vpn_(false),
+ unreachable_(false),
prefs_(NULL),
local_state_prefs_(NULL),
url_request_context_getter_(NULL) {
@@ -207,14 +208,13 @@ DataReductionProxySettings::GetDailyOriginalContentLengths() {
return GetDailyContentLengths(prefs::kDailyHttpOriginalContentLength);
}
-bool DataReductionProxySettings::IsDataReductionProxyUnreachable() {
- DCHECK(thread_checker_.CalledOnValidThread());
- return usage_stats_ && usage_stats_->isDataReductionProxyUnreachable();
+void DataReductionProxySettings::SetUnreachable(bool unreachable) {
+ unreachable_ = unreachable;
}
-void DataReductionProxySettings::SetDataReductionProxyUsageStats(
- DataReductionProxyUsageStats* usage_stats) {
- usage_stats_ = usage_stats;
+bool DataReductionProxySettings::IsDataReductionProxyUnreachable() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return unreachable_;
}
DataReductionProxySettings::ContentLengthList
@@ -293,6 +293,7 @@ PrefService* DataReductionProxySettings::GetLocalStatePrefs() {
void DataReductionProxySettings::AddDefaultProxyBypassRules() {
// localhost
+ DCHECK(configurator_);
configurator_->AddHostPatternToBypass("<local>");
// RFC1918 private addresses.
configurator_->AddHostPatternToBypass("10.0.0.0/8");
@@ -303,6 +304,16 @@ void DataReductionProxySettings::AddDefaultProxyBypassRules() {
// IPV6 probe addresses.
configurator_->AddHostPatternToBypass("*-ds.metric.gstatic.com");
configurator_->AddHostPatternToBypass("*-v4.metric.gstatic.com");
+#if defined(OS_ANDROID)
+ // Chrome cannot authenticate with the data reduction proxy when fetching URLs
+ // from the settings menu.
+ configurator_->AddURLPatternToBypass(
+ "http://www.google.com/policies/privacy*");
+ configurator_->AddHostPatternToBypass("*freezone.google.com");
+ configurator_->AddHostPatternToBypass("freezone.googleusercontent.com");
+ configurator_->AddURLPatternToBypass("http://g.co/gms/*");
+ configurator_->AddURLPatternToBypass("http://g.co/freezone*");
+#endif
}
void DataReductionProxySettings::LogProxyState(
@@ -394,6 +405,8 @@ void DataReductionProxySettings::SetProxyConfigs(bool enabled,
bool restricted,
bool at_startup) {
DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(configurator_);
+
LogProxyState(enabled, restricted, at_startup);
// The alternative is only configured if the standard configuration is
// is enabled.

Powered by Google App Engine
This is Rietveld 408576698