13
13
#include " mozilla/AlreadyAddRefed.h"
14
14
#include " mozilla/ClearOnShutdown.h"
15
15
#include " mozilla/ContentBlockingAllowList.h"
16
- #include " mozilla/glean/GleanMetrics.h"
17
16
#include " mozilla/Logging.h"
18
17
#include " mozilla/Services.h"
19
18
#include " mozilla/StaticPrefs_privacy.h"
@@ -587,8 +586,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal(
587
586
588
587
RefPtr<ClearDataMozPromise::Private> clearPromise =
589
588
new ClearDataMozPromise::Private (__func__);
590
- RefPtr<ClearDataCallback> cb =
591
- new ClearDataCallback (clearPromise, host, bounceTime);
589
+ RefPtr<ClearDataCallback> cb = new ClearDataCallback (clearPromise, host);
592
590
593
591
MOZ_LOG (gBounceTrackingProtectionLog , LogLevel::Debug,
594
592
(" %s: Purge state for host: %s" , __FUNCTION__,
@@ -597,9 +595,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal(
597
595
if (StaticPrefs::privacy_bounceTrackingProtection_enableDryRunMode ()) {
598
596
// In dry-run mode, we don't actually clear the data, but we still want to
599
597
// 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__);
603
599
} else {
604
600
// TODO: Bug 1842067: Clear by site + OA.
605
601
rv = clearDataService->DeleteDataFromBaseDomain (host, false ,
@@ -668,38 +664,13 @@ NS_IMPL_ISUPPORTS(BounceTrackingProtection::ClearDataCallback,
668
664
NS_IMETHODIMP BounceTrackingProtection::ClearDataCallback::OnDataDeleted (
669
665
uint32_t aFailedFlags) {
670
666
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
-
677
667
mPromise ->Reject (aFailedFlags, __func__);
678
668
} else {
679
669
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 ()));
684
671
mPromise ->Resolve (std::move (mHost ), __func__);
685
672
}
686
673
return NS_OK;
687
674
}
688
675
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
-
705
676
} // namespace mozilla
0 commit comments