| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
|
| index d17965717789f81b9ab2ff0ddeee247157e30a14..1664cc1862a7728e07bba4959340181456c6ec08 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
|
| @@ -223,6 +223,21 @@ void DataReductionProxyBypassStats::OnConnectComplete(
|
| }
|
| }
|
|
|
| +void DataReductionProxyBypassStats::ClearRequestCounts() {
|
| + successful_requests_through_proxy_count_ = 0;
|
| + proxy_net_errors_count_ = 0;
|
| +}
|
| +
|
| +void DataReductionProxyBypassStats::NotifyUnavailabilityIfChanged() {
|
| + bool prev_unavailable = unavailable_;
|
| + unavailable_ =
|
| + (proxy_net_errors_count_ >= kMinFailedRequestsWhenUnavailable &&
|
| + successful_requests_through_proxy_count_ <=
|
| + kMaxSuccessfulRequestsWhenUnavailable);
|
| + if (prev_unavailable != unavailable_)
|
| + unreachable_callback_.Run(unavailable_);
|
| +}
|
| +
|
| void DataReductionProxyBypassStats::RecordBypassedBytesHistograms(
|
| const net::URLRequest& request,
|
| bool data_reduction_proxy_enabled,
|
| @@ -365,21 +380,6 @@ void DataReductionProxyBypassStats::OnNetworkChanged(
|
| ClearRequestCounts();
|
| }
|
|
|
| -void DataReductionProxyBypassStats::ClearRequestCounts() {
|
| - successful_requests_through_proxy_count_ = 0;
|
| - proxy_net_errors_count_ = 0;
|
| -}
|
| -
|
| -void DataReductionProxyBypassStats::NotifyUnavailabilityIfChanged() {
|
| - bool prev_unavailable = unavailable_;
|
| - unavailable_ =
|
| - (proxy_net_errors_count_ >= kMinFailedRequestsWhenUnavailable &&
|
| - successful_requests_through_proxy_count_ <=
|
| - kMaxSuccessfulRequestsWhenUnavailable);
|
| - if (prev_unavailable != unavailable_)
|
| - unreachable_callback_.Run(unavailable_);
|
| -}
|
| -
|
| void DataReductionProxyBypassStats::RecordBypassedBytes(
|
| DataReductionProxyBypassType bypass_type,
|
| DataReductionProxyBypassStats::BypassedBytesType bypassed_bytes_type,
|
|
|