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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc

Issue 1006583002: Reset unreachable data reduction proxy message when data savings is toggled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Vector initialization. Created 5 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
index 50a303cf7849faa3f32a8787cafbe931c7e41573..9de8165d996f098cb9b52e1917895ffd55b4ed93 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -215,12 +215,24 @@ DataReductionProxyIOData::CreateNetworkDelegate(
return network_delegate.Pass();
}
+// TODO(kundaji): Rename this method to something more descriptive.
+// Bug http://crbug/488190.
void DataReductionProxyIOData::SetProxyPrefs(bool enabled,
bool alternative_enabled,
bool at_startup) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
+ DCHECK(url_request_context_getter_->GetURLRequestContext()->proxy_service());
enabled_ = enabled;
config_->SetProxyConfig(enabled, alternative_enabled, at_startup);
+
+ // If Data Saver is disabled, reset data reduction proxy state.
+ if (!enabled) {
+ net::ProxyService* proxy_service =
+ url_request_context_getter_->GetURLRequestContext()->proxy_service();
+ proxy_service->ClearBadProxiesCache();
+ bypass_stats_->ClearRequestCounts();
+ bypass_stats_->NotifyUnavailabilityIfChanged();
+ }
}
void DataReductionProxyIOData::UpdateContentLengths(

Powered by Google App Engine
This is Rietveld 408576698