Bug 1197998 - Use counters for Push subscribe, unsubscribe and permission query. r=froydnj,kitcambridge,jst
authorNikhil Marathe <nsm.nikhil@gmail.com>
Thu, 03 Sep 2015 17:54:59 -0700
changeset 294041 2fd91dc12a4219ac7d7631455774a31483d85cb4
parent 294040 ce582bee57cb1a7a81303dc3b41289c01345b06a
child 294042 69b07795c5fa8718d7119eb7c0319318edf66d7f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, kitcambridge, jst
bugs1197998
milestone43.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 1197998 - Use counters for Push subscribe, unsubscribe and permission query. r=froydnj,kitcambridge,jst Counters do not currently work on Web Workers, so it a no-op on non main thread.
dom/base/UseCounters.conf
dom/webidl/PushManager.webidl
dom/webidl/PushSubscription.webidl
--- a/dom/base/UseCounters.conf
+++ b/dom/base/UseCounters.conf
@@ -37,8 +37,12 @@
 // dependencies were correct would have been rather difficult, and
 // annotating the WebIDL files does nothing for identifying CSS
 // property usage, which we would also like to track.
 
 method SVGSVGElement.getElementById
 attribute SVGSVGElement.currentScale
 property Fill
 property FillOpacity
+
+// Push API
+method PushManager.subscribe
+method PushSubscription.unsubscribe
--- a/dom/webidl/PushManager.webidl
+++ b/dom/webidl/PushManager.webidl
@@ -22,17 +22,17 @@ interface PushManagerImpl {
     [Func="ServiceWorkerRegistration::WebPushMethodHider"] void setScope(DOMString scope);
 };
 
 [Exposed=(Window,Worker), Func="nsContentUtils::PushEnabled"]
 interface PushManager {
   [ChromeOnly, Throws, Exposed=Window]
   void setPushManagerImpl(PushManagerImpl store);
 
-  [Throws]
+  [Throws, UseCounter]
   Promise<PushSubscription>     subscribe();
   [Throws]
   Promise<PushSubscription?>    getSubscription();
   [Throws]
   Promise<PushPermissionState> permissionState();
 };
 
 enum PushPermissionState
--- a/dom/webidl/PushSubscription.webidl
+++ b/dom/webidl/PushSubscription.webidl
@@ -9,16 +9,16 @@
 
 interface Principal;
 
 [Exposed=(Window,Worker), Func="nsContentUtils::PushEnabled",
  ChromeConstructor(DOMString pushEndpoint, DOMString scope)]
 interface PushSubscription
 {
     readonly attribute USVString endpoint;
-    [Throws]
+    [Throws, UseCounter]
     Promise<boolean> unsubscribe();
     jsonifier;
 
     // Used to set the principal from the JS implemented PushManager.
     [Exposed=Window,ChromeOnly]
     void setPrincipal(Principal principal);
 };