Backed out changeset 2c479e5f52df (bug 1798986) for causing failures on browser_urlQueryStringStripping_telemetry.js. CLOSED TREE

This commit is contained in:
Csoregi Natalia
2022-11-14 20:51:27 +02:00
parent 7045d63156
commit 17a6c794ec
9 changed files with 49 additions and 90 deletions

View File

@@ -578,7 +578,7 @@ bool nsDocShellLoadState::LoadIsFromSessionHistory() const {
}
void nsDocShellLoadState::MaybeStripTrackerQueryStrings(
BrowsingContext* aContext) {
BrowsingContext* aContext, nsIURI* aCurrentUnstrippedURI) {
MOZ_ASSERT(aContext);
// Return early if the triggering principal doesn't exist. This could happen
@@ -619,14 +619,17 @@ void nsDocShellLoadState::MaybeStripTrackerQueryStrings(
uint32_t numStripped = URLQueryStringStripper::Strip(
URI(), aContext->UsePrivateBrowsing(), strippedURI);
if (numStripped) {
if (!mUnstrippedURI) {
mUnstrippedURI = URI();
}
mUnstrippedURI = URI();
SetURI(strippedURI);
Telemetry::AccumulateCategorical(
Telemetry::LABELS_QUERY_STRIPPING_COUNT::StripForNavigation);
Telemetry::Accumulate(Telemetry::QUERY_STRIPPING_PARAM_COUNT, numStripped);
} 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
// off.
mUnstrippedURI = aCurrentUnstrippedURI;
}
#ifdef DEBUG
@@ -1073,7 +1076,3 @@ DocShellLoadStateInit nsDocShellLoadState::Serialize() {
}
nsIURI* nsDocShellLoadState::GetUnstrippedURI() const { return mUnstrippedURI; }
void nsDocShellLoadState::SetUnstrippedURI(nsIURI* aUnstrippedURI) {
mUnstrippedURI = aUnstrippedURI;
}