Bug 1241278 - Record telemetry for notification permission callback usage. r?vladan
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -651,16 +651,18 @@ nsresult
NotificationPermissionRequest::ResolvePromise()
{
nsresult rv = NS_OK;
if (mCallback) {
ErrorResult error;
mCallback->Call(mPermission, error);
rv = error.StealNSResult();
}
+ Telemetry::Accumulate(
+ Telemetry::WEB_NOTIFICATION_REQUEST_PERMISSION_CALLBACK, !!mCallback);
mPromise->MaybeResolve(mPermission);
return rv;
}
NS_IMETHODIMP
NotificationPermissionRequest::GetTypes(nsIArray** aTypes)
{
nsTArray<nsString> emptyOptions;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10052,10 +10052,17 @@
},
"PLUGIN_DRAWING_MODEL": {
"alert_emails": ["danderson@mozilla.com"],
"expires_in_version": "never",
"kind": "enumerated",
"bug_numbers": [1229961],
"n_values": 12,
"description": "Plugin drawing model. 0 when windowed, otherwise NPDrawingModel + 1."
+ },
+ "WEB_NOTIFICATION_REQUEST_PERMISSION_CALLBACK": {
+ "alert_emails": ["push@mozilla.com"],
+ "expires_in_version": "55",
+ "bug_numbers": [1241278],
+ "kind": "boolean",
+ "description": "Usage of the deprecated Notification.requestPermission() callback argument"
}
}