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 15e9b941c19b8c38d172fb0ed3637c356e44e9ca..1e523a3d22d067ebdd3fcbf965c77d31f17ef570 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 |
@@ -54,6 +54,17 @@ using base::FieldTrialList; |
namespace { |
+// Values of the UMA DataReductionProxy.Protocol.NotAcceptingTransform histogram |
+// defined in metrics/histograms/histograms.xml. This enum must remain |
+// synchronized with DataReductionProxyProtocolNotAcceptingTransformReason in |
+// tools/metrics/histograms/enums.xml. |
+enum NotAcceptingTransformReason { |
+ NOT_ACCEPTING_TRANSFORM_DISABLED = 0, |
+ NOT_ACCEPTING_TRANSFORM_BLACKLISTED = 1, |
+ NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY = 2, |
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY |
+}; |
+ |
// Values of the UMA DataReductionProxy.NetworkChangeEvents histograms. |
// This enum must remain synchronized with the enum of the same |
// name in metrics/histograms/histograms.xml. |
@@ -1073,17 +1084,30 @@ bool DataReductionProxyConfig::ShouldAcceptServerPreview( |
// For the transition to server-driven previews decisions, we will |
// use existing Lo-Fi flags for disabling and cellular-only mode. |
// TODO(dougarnett): Refactor flag names as part of bug 725645. |
- if (params::IsLoFiDisabledViaFlags()) { |
+ if (params::IsLoFiDisabledViaFlags() || lofi_off()) { |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "DataReductionProxy.Protocol.NotAcceptingTransform", |
+ NOT_ACCEPTING_TRANSFORM_DISABLED, |
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); |
return false; |
} |
if (IsBlackListedOrDisabled(request, previews_decider, |
previews::PreviewsType::LITE_PAGE)) { |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "DataReductionProxy.Protocol.NotAcceptingTransform", |
+ NOT_ACCEPTING_TRANSFORM_BLACKLISTED, |
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); |
return false; |
} |
- if (params::IsLoFiCellularOnlyViaFlags()) { |
- return net::NetworkChangeNotifier::IsConnectionCellular(connection_type_); |
+ if (params::IsLoFiCellularOnlyViaFlags() && |
+ !net::NetworkChangeNotifier::IsConnectionCellular(connection_type_)) { |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "DataReductionProxy.Protocol.NotAcceptingTransform", |
+ NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY, |
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY); |
+ return false; |
} |
return true; |