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

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

Issue 1123173004: Do not disable Data Reduction Proxy on VPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head 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_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index 296436b6b09db8516cd305fc1dc034817be0e052..aba1815be2f74d5998e5386c1c8cf26c45923843 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -483,7 +483,7 @@ void DataReductionProxyConfig::OnIPAddressChanged() {
if (enabled_by_user_) {
DCHECK(config_values_->allowed());
RecordNetworkChangeEvent(IP_CHANGED);
- if (DisableIfVPN())
+ if (MaybeDisableIfVPN())
return;
if (alternative_enabled_by_user_ &&
!config_values_->alternative_fallback_allowed()) {
@@ -560,12 +560,15 @@ void DataReductionProxyConfig::GetNetworkList(
net::GetNetworkList(interfaces, policy);
}
-bool DataReductionProxyConfig::DisableIfVPN() {
+bool DataReductionProxyConfig::MaybeDisableIfVPN() {
+ if (DataReductionProxyParams::IsIncludedInUseDataSaverOnVPNFieldTrial()) {
+ return false;
+ }
net::NetworkInterfaceList network_interfaces;
GetNetworkList(&network_interfaces, 0);
// VPNs use a "tun" interface, so the presence of a "tun" interface indicates
- // a VPN is in use.
- // TODO(kundaji): Verify this works on Windows.
+ // a VPN is in use. This logic only works on Android and Linux platforms.
+ // Data Saver will not be disabled on any other platform on VPN.
const std::string vpn_interface_name_prefix = "tun";
for (size_t i = 0; i < network_interfaces.size(); ++i) {
std::string interface_name = network_interfaces[i].name;

Powered by Google App Engine
This is Rietveld 408576698