Bug 1706616 - Part 1: Add telemetry probe for query stripping. r=dimi,necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D117006
This commit is contained in:
Tim Huang
2021-06-10 08:20:27 +00:00
parent 292501e4bf
commit 8694408c02
3 changed files with 29 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include "mozilla/dom/LoadURIOptionsBinding.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_fission.h"
#include "mozilla/Telemetry.h"
#include "mozilla/URLQueryStringStripper.h"
#include "mozilla/OriginAttributes.h"
@@ -601,10 +602,16 @@ void nsDocShellLoadState::MaybeStripTrackerQueryStrings(
return;
}
Telemetry::AccumulateCategorical(
Telemetry::LABELS_QUERY_STRIPPING_COUNT::Navigation);
nsCOMPtr<nsIURI> strippedURI;
if (URLQueryStringStripper::Strip(URI(), strippedURI)) {
mUnstrippedURI = URI();
SetURI(strippedURI);
Telemetry::AccumulateCategorical(
Telemetry::LABELS_QUERY_STRIPPING_COUNT::StripForNavigation);
} else if (LoadType() & nsIDocShell::LOAD_CMD_RELOAD) {
// Preserve the Unstripped URI if it's a reload. By doing this, we can
// restore the stripped query parameters once the ETP has been toggled to