Bug 1429016 - Remove expiring WEB_NOTIFICATION_* telemetry probes r=MattN
authorui.manish <1991manish.kumar@gmail.com>
Sat, 23 Feb 2019 09:56:08 +0000
changeset 518613 9eb8e5cca281f47dbdcc9b43baba61a82d68258a
parent 518612 2b6a33e51e63b07d0e7b9bcf545546c841279083
child 518614 a6add7613778e3f53580978edb005341d9f6eca7
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1429016
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1429016 - Remove expiring WEB_NOTIFICATION_* telemetry probes r=MattN Differential Revision: https://phabricator.services.mozilla.com/D18877
browser/components/preferences/in-content/privacy.js
dom/notification/Notification.cpp
toolkit/components/alerts/resources/content/alert.js
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -1088,21 +1088,16 @@ var gPrivacyPane = {
    * Displays the notifications exceptions dialog where specific site notification
    * preferences can be set.
    */
   showNotificationExceptions() {
     let params = { permissionType: "desktop-notification" };
 
     gSubDialog.open("chrome://browser/content/preferences/sitePermissions.xul",
       "resizable=yes", params);
-
-    try {
-      Services.telemetry
-        .getHistogramById("WEB_NOTIFICATION_EXCEPTIONS_OPENED").add();
-    } catch (e) { }
   },
 
 
   // MEDIA
 
   blockAutoplayReadPrefs() {
     let blocked =
       Preferences.get("media.autoplay.default").value == Ci.nsIAutoplay.BLOCKED;
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -618,21 +618,16 @@ void NotificationTelemetryService::Recor
     rv = enumerator->GetNext(getter_AddRefs(supportsPermission));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return;
     }
     uint32_t capability;
     if (!GetNotificationPermission(supportsPermission, &capability)) {
       continue;
     }
-    if (capability == nsIPermissionManager::DENY_ACTION) {
-      Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_PERMISSIONS, 0);
-    } else if (capability == nsIPermissionManager::ALLOW_ACTION) {
-      Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_PERMISSIONS, 1);
-    }
   }
 }
 
 bool NotificationTelemetryService::GetNotificationPermission(
     nsISupports* aSupports, uint32_t* aCapability) {
   nsCOMPtr<nsIPermission> permission = do_QueryInterface(aSupports);
   if (!permission) {
     return false;
@@ -1124,30 +1119,26 @@ class NotificationClickWorkerRunnable fi
 };
 
 NS_IMETHODIMP
 NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
                               const char16_t* aData) {
   AssertIsOnMainThread();
 
   if (!strcmp("alertdisablecallback", aTopic)) {
-    Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_MENU, 1);
     if (XRE_IsParentProcess()) {
       return Notification::RemovePermission(mPrincipal);
     }
     // Permissions can't be removed from the content process. Send a message
     // to the parent; `ContentParent::RecvDisableNotifications` will call
     // `RemovePermission`.
     ContentChild::GetSingleton()->SendDisableNotifications(
         IPC::Principal(mPrincipal));
     return NS_OK;
-  } else if (!strcmp("alertclickcallback", aTopic)) {
-    Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_CLICKED, 1);
   } else if (!strcmp("alertsettingscallback", aTopic)) {
-    Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_MENU, 2);
     if (XRE_IsParentProcess()) {
       return Notification::OpenSettings(mPrincipal);
     }
     // `ContentParent::RecvOpenNotificationSettings` notifies observers in the
     // parent process.
     ContentChild::GetSingleton()->SendOpenNotificationSettings(
         IPC::Principal(mPrincipal));
     return NS_OK;
@@ -1155,21 +1146,16 @@ NotificationObserver::Observe(nsISupport
     RefPtr<NotificationTelemetryService> telemetry =
         NotificationTelemetryService::GetInstance();
     if (telemetry) {
       // Record whether "do not disturb" is supported after the first
       // notification, to account for falling back to XUL alerts.
       telemetry->RecordDNDSupported();
     }
     Unused << NS_WARN_IF(NS_FAILED(AdjustPushQuota(aTopic)));
-
-    if (!strcmp("alertshow", aTopic)) {
-      // Record notifications actually shown (e.g. don't count if DND is on).
-      Telemetry::Accumulate(Telemetry::WEB_NOTIFICATION_SHOWN, 1);
-    }
   }
 
   return mObserver->Observe(aSubject, aTopic, aData);
 }
 
 nsresult NotificationObserver::AdjustPushQuota(const char* aTopic) {
   nsCOMPtr<nsIPushQuotaManager> pushQuotaManager =
       do_GetService("@mozilla.org/push/Service;1");
--- a/toolkit/components/alerts/resources/content/alert.js
+++ b/toolkit/components/alerts/resources/content/alert.js
@@ -281,18 +281,16 @@ function onAlertClick() {
   }
 }
 
 function doNotDisturb() {
   const alertService = Cc["@mozilla.org/alerts-service;1"]
                          .getService(Ci.nsIAlertsService)
                          .QueryInterface(Ci.nsIAlertsDoNotDisturb);
   alertService.manualDoNotDisturb = true;
-  Services.telemetry.getHistogramById("WEB_NOTIFICATION_MENU")
-                    .add(0);
   onAlertClose();
 }
 
 function disableForOrigin() {
   gAlertListener.observe(null, "alertdisablecallback", gAlertCookie);
   onAlertClose();
 }
 
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -12565,43 +12565,16 @@
     "record_in_processes": ["main", "content", "gpu"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 100,
     "releaseChannelCollection": "opt-out",
     "description": "Graphics Crash Reason (...)"
   },
-  "WEB_NOTIFICATION_CLICKED": {
-    "record_in_processes": ["main", "content"],
-    "releaseChannelCollection": "opt-out",
-    "alert_emails": ["firefox-dev@mozilla.org", "push@mozilla.com"],
-    "bug_numbers": [1225336, 1429286],
-    "expires_in_version": "never",
-    "kind": "count",
-    "description": "Count of times a web notification was clicked"
-  },
-  "WEB_NOTIFICATION_MENU": {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["firefox-dev@mozilla.org"],
-    "bug_numbers": [1225336],
-    "expires_in_version": "50",
-    "kind": "enumerated",
-    "n_values": 5,
-    "description": "Count of times a contextual menu item was used from a Notification (0: DND, 1: Disable, 2: Settings)"
-  },
-  "WEB_NOTIFICATION_SHOWN": {
-    "record_in_processes": ["main", "content"],
-    "releaseChannelCollection": "opt-out",
-    "alert_emails": ["firefox-dev@mozilla.org", "push@mozilla.com"],
-    "bug_numbers": [1225336, 1429286],
-    "expires_in_version": "never",
-    "kind": "count",
-    "description": "Count of times a Notification was rendered (accounting for XUL DND). A system backend may put the notification directly into the tray if its own DND is on."
-  },
   "WEBFONT_DOWNLOAD_TIME": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["jdaggett@mozilla.com"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 60000,
     "n_buckets": 50,
     "description": "Time to download a webfont (ms)"
@@ -12691,34 +12664,16 @@
   "ALERTS_SERVICE_DND_SUPPORTED_FLAG": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["firefox-dev@mozilla.org"],
     "bug_numbers": [1219030],
     "expires_in_version": "50",
     "kind": "flag",
     "description": "Whether the do not disturb option is supported. True if the browser uses XUL alerts."
   },
-  "WEB_NOTIFICATION_EXCEPTIONS_OPENED": {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["firefox-dev@mozilla.org"],
-    "bug_numbers": [1219030],
-    "expires_in_version": "50",
-    "kind": "count",
-    "description": "Number of times the Notification Permissions dialog has been opened."
-  },
-  "WEB_NOTIFICATION_PERMISSIONS": {
-    "record_in_processes": ["main", "content"],
-    "releaseChannelCollection": "opt-out",
-    "alert_emails": ["firefox-dev@mozilla.org", "push@mozilla.com"],
-    "bug_numbers": [1219030, 1429286],
-    "expires_in_version": "never",
-    "kind": "enumerated",
-    "n_values": 10,
-    "description": "Number of origins with the web notifications permission (0 = denied, 1 = allowed)."
-  },
   "PLUGIN_DRAWING_MODEL": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "bug_numbers": [1229961],
     "n_values": 12,
     "releaseChannelCollection": "opt-out",
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -1542,14 +1542,11 @@
     "UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL",
     "UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY",
     "UPDATE_UNABLE_TO_APPLY_EXTERNAL",
     "UPDATE_UNABLE_TO_APPLY_NOTIFY",
     "VIDEO_FASTSEEK_USED",
     "WEBFONT_PER_PAGE",
     "WEBRTC_CALL_COUNT_2",
     "WEBVTT_USED_VTT_CUES",
-    "WEB_NOTIFICATION_CLICKED",
-    "WEB_NOTIFICATION_EXCEPTIONS_OPENED",
-    "WEB_NOTIFICATION_SHOWN",
     "XUL_CACHE_DISABLED"
   ]
 }