Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 32aceda

Browse files
committed
Revert "Bug 1889444 - Record a Glean event for sites purged by Bounce Tracking Protection." r=bvandersloot,anti-tracking-reviewers
This reverts commit d13642ffba96ff2b73f1b442387fbea6f986fdab. Differential Revision: https://phabricator.services.mozilla.com/D208510
1 parent cf60c8c commit 32aceda

File tree

4 files changed

+5
-80
lines changed

4 files changed

+5
-80
lines changed

toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "mozilla/AlreadyAddRefed.h"
1414
#include "mozilla/ClearOnShutdown.h"
1515
#include "mozilla/ContentBlockingAllowList.h"
16-
#include "mozilla/glean/GleanMetrics.h"
1716
#include "mozilla/Logging.h"
1817
#include "mozilla/Services.h"
1918
#include "mozilla/StaticPrefs_privacy.h"
@@ -587,8 +586,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal(
587586

588587
RefPtr<ClearDataMozPromise::Private> clearPromise =
589588
new ClearDataMozPromise::Private(__func__);
590-
RefPtr<ClearDataCallback> cb =
591-
new ClearDataCallback(clearPromise, host, bounceTime);
589+
RefPtr<ClearDataCallback> cb = new ClearDataCallback(clearPromise, host);
592590

593591
MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug,
594592
("%s: Purge state for host: %s", __FUNCTION__,
@@ -597,9 +595,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal(
597595
if (StaticPrefs::privacy_bounceTrackingProtection_enableDryRunMode()) {
598596
// In dry-run mode, we don't actually clear the data, but we still want to
599597
// resolve the promise to indicate that the data would have been cleared.
600-
// Go through ClearDataCallback rather than directly resolving the promise
601-
// to ensure telemetry is collected.
602-
cb->OnDataDeleted(0);
598+
clearPromise->Resolve(host, __func__);
603599
} else {
604600
// TODO: Bug 1842067: Clear by site + OA.
605601
rv = clearDataService->DeleteDataFromBaseDomain(host, false,
@@ -668,38 +664,13 @@ NS_IMPL_ISUPPORTS(BounceTrackingProtection::ClearDataCallback,
668664
NS_IMETHODIMP BounceTrackingProtection::ClearDataCallback::OnDataDeleted(
669665
uint32_t aFailedFlags) {
670666
if (aFailedFlags) {
671-
MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Error,
672-
("%s: Failed to clear mHost: %s, mBounceTime: %" PRIu64
673-
", aFailedFlags: %d",
674-
__FUNCTION__, mHost.get(), mBounceTime, aFailedFlags));
675-
RecordClearDataTelemetry(false);
676-
677667
mPromise->Reject(aFailedFlags, __func__);
678668
} else {
679669
MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Info,
680-
("%s: Cleared: mHost: %s, mBounceTime: %" PRIu64, __FUNCTION__,
681-
mHost.get(), mBounceTime));
682-
RecordClearDataTelemetry(true);
683-
670+
("%s: Cleared %s", __FUNCTION__, mHost.get()));
684671
mPromise->Resolve(std::move(mHost), __func__);
685672
}
686673
return NS_OK;
687674
}
688675

689-
void BounceTrackingProtection::ClearDataCallback::RecordClearDataTelemetry(
690-
bool success) {
691-
// Record a glean event for the clear action. This is only recorded in
692-
// pre-release channels since we record the site host which is considered
693-
// category 3 data.
694-
// https://wiki.mozilla.org/Data_Collection#Data_Collection_Categories
695-
#if defined(EARLY_BETA_OR_EARLIER)
696-
glean::bounce_tracking_protection::ActionPurgeExtra extra = {
697-
.bounceTime = Some(mBounceTime / PR_USEC_PER_SEC),
698-
.siteHost = Some(mHost),
699-
.success = Some(success),
700-
};
701-
glean::bounce_tracking_protection::action_purge.Record(Some(extra));
702-
#endif // defined(EARLY_BETA_OR_EARLIER)
703-
}
704-
705676
} // namespace mozilla

toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,13 @@ class BounceTrackingProtection final : public nsIBounceTrackingProtection {
8282
NS_DECL_NSICLEARDATACALLBACK
8383

8484
explicit ClearDataCallback(ClearDataMozPromise::Private* aPromise,
85-
const nsACString& aHost,
86-
const PRTime aBounceTime)
87-
: mHost(aHost), mBounceTime(aBounceTime), mPromise(aPromise) {
88-
MOZ_ASSERT(!aHost.IsEmpty(), "Host must not be empty");
89-
MOZ_ASSERT(aBounceTime > 0, "Bounce time must be a valid timestamp.");
90-
};
85+
const nsACString& aHost)
86+
: mHost(aHost), mPromise(aPromise){};
9187

9288
private:
9389
virtual ~ClearDataCallback() { mPromise->Reject(0, __func__); }
9490

95-
void RecordClearDataTelemetry(bool success);
96-
9791
nsCString mHost;
98-
PRTime mBounceTime;
9992
RefPtr<ClearDataMozPromise::Private> mPromise;
10093
};
10194
};

toolkit/components/antitracking/bouncetrackingprotection/metrics.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

toolkit/components/glean/metrics_index.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"netwerk/protocol/http/metrics.yaml",
3636
"security/certverifier/metrics.yaml",
3737
"security/manager/ssl/metrics.yaml",
38-
"toolkit/components/antitracking/bouncetrackingprotection/metrics.yaml",
3938
"toolkit/components/cookiebanners/metrics.yaml",
4039
"toolkit/components/extensions/metrics.yaml",
4140
"toolkit/components/formautofill/metrics.yaml",

0 commit comments

Comments
 (0)