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

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

Issue 2777823002: Bypass DRP if a redirect cycle is detected (Closed)
Patch Set: ryansturm comments Created 3 years, 9 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_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 3aa6b85d42d790a99c0a7436f4bad587d4f719cd..718c1f234b06545e9035e04ea78503e606db26b0 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
@@ -100,8 +100,8 @@ void DataReductionProxyBypassStats::RecordDataReductionProxyBypassInfo(
// static
void DataReductionProxyBypassStats::DetectAndRecordMissingViaHeaderResponseCode(
bool is_primary,
- const net::HttpResponseHeaders* headers) {
- if (HasDataReductionProxyViaHeader(headers, NULL)) {
+ const net::HttpResponseHeaders& headers) {
+ if (HasDataReductionProxyViaHeader(headers, nullptr)) {
// The data reduction proxy via header is present, so don't record anything.
return;
}
@@ -109,11 +109,11 @@ void DataReductionProxyBypassStats::DetectAndRecordMissingViaHeaderResponseCode(
if (is_primary) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"DataReductionProxy.MissingViaHeader.ResponseCode.Primary",
- headers->response_code());
+ headers.response_code());
} else {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"DataReductionProxy.MissingViaHeader.ResponseCode.Fallback",
- headers->response_code());
+ headers.response_code());
}
}
@@ -385,7 +385,7 @@ void DataReductionProxyBypassStats::RecordMissingViaHeaderBytes(
if (!data_reduction_proxy_config_->WasDataReductionProxyUsed(&request,
NULL) ||
- HasDataReductionProxyViaHeader(request.response_headers(), NULL)) {
+ HasDataReductionProxyViaHeader(*request.response_headers(), NULL)) {
// Only track requests that used the data reduction proxy and had responses
// that were missing the data reduction proxy via header.
return;
@@ -537,6 +537,11 @@ void DataReductionProxyBypassStats::RecordBypassedBytes(
"Status503HttpServiceUnavailable",
content_length);
break;
+ case BYPASS_EVENT_TYPE_URL_REDIRECT_CYCLE:
+ UMA_HISTOGRAM_COUNTS(
+ "DataReductionProxy.BypassedBytes.URLRedirectCycle",
+ content_length);
+ break;
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698