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

Unified Diff: components/variations/net/variations_http_headers.cc

Issue 2575823003: Fixing histogram logging to better track variations headers https change. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/net/variations_http_headers.cc
diff --git a/components/variations/net/variations_http_headers.cc b/components/variations/net/variations_http_headers.cc
index 1729ededccbe73507b50996f853a727c5a80b6a3..c02faea872f35e62276053c60be01c1c89a3a4c7 100644
--- a/components/variations/net/variations_http_headers.cc
+++ b/components/variations/net/variations_http_headers.cc
@@ -48,11 +48,13 @@ enum URLValidationResult {
NOT_HTTPS,
NOT_GOOGLE_DOMAIN,
SHOULD_APPEND,
+ NEITHER_HTTP_HTTPS,
+ IS_GOOGLE_NOT_HTTPS,
URL_VALIDATION_RESULT_SIZE,
};
// Checks whether headers should be appended to the |url|, based on the domain
-// of |url|. |url| is assumed to be valid, and to have the https scheme.
+// of |url|. |url| is assumed to be valid, and to have an http/https scheme.
bool IsGoogleDomain(const GURL& url) {
if (google_util::IsGoogleDomainUrl(url, google_util::ALLOW_SUBDOMAIN,
google_util::ALLOW_NON_STANDARD_PORTS)) {
@@ -131,15 +133,20 @@ bool ShouldAppendVariationHeaders(const GURL& url) {
LogUrlValidationHistogram(INVALID_URL);
return false;
}
- if (!url.SchemeIs("https")) {
- LogUrlValidationHistogram(NOT_HTTPS);
+ if (!url.SchemeIsHTTPOrHTTPS()) {
+ LogUrlValidationHistogram(NEITHER_HTTP_HTTPS);
return false;
}
if (!IsGoogleDomain(url)) {
LogUrlValidationHistogram(NOT_GOOGLE_DOMAIN);
return false;
}
-
+ // We check https here, rather than before the IsGoogleDomain() check, to know
+ // how many Google domains are being rejected by the change to https only.
+ if (!url.SchemeIs("https")) {
+ LogUrlValidationHistogram(IS_GOOGLE_NOT_HTTPS);
+ return false;
+ }
LogUrlValidationHistogram(SHOULD_APPEND);
return true;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698