Backed out changeset 675ea8aeb804 (bug 884897) for breaking builds on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 30 Jul 2013 15:31:10 -0700
changeset 152923 c2b375f3a909fed4dd66947b88bd63e414c8d97e
parent 152922 0d8409268f42fb2d9847ac7e874eb3036a284816
child 152924 e7d81c2597f2fc731d6cf3adec406c6c98e3ac01
child 152992 065af7f400f861d937a7409e179d8b44e78fa23c
child 153006 46668a08f3e4e8891acd27687d3a17367b6fee36
child 170182 36ed8db7aadcc90447d6c98c617f66667402c4af
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs884897
milestone25.0a1
backs out675ea8aeb80419fe723f0a7c9df1b1cc3b090249
first release with
nightly linux32
c2b375f3a909 / 25.0a1 / 20130731030203 / files
nightly linux64
c2b375f3a909 / 25.0a1 / 20130731030203 / files
nightly mac
c2b375f3a909 / 25.0a1 / 20130731030203 / files
nightly win32
c2b375f3a909 / 25.0a1 / 20130731030203 / files
nightly win64
c2b375f3a909 / 25.0a1 / 20130731030203 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 675ea8aeb804 (bug 884897) for breaking builds on a CLOSED TREE
dom/interfaces/push/moz.build
dom/interfaces/push/nsIDOMPushManager.idl
dom/moz.build
dom/push/src/Push.js
dom/push/src/Push.manifest
dom/push/src/PushServiceLauncher.js
dom/webidl/PushManager.webidl
dom/webidl/WebIDL.mk
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/push/moz.build
@@ -0,0 +1,9 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+MODULE        = 'dom'
+XPIDL_MODULE  = 'dom_push'
+XPIDL_SOURCES += ['nsIDOMPushManager.idl']
+XPIDL_FLAGS += ['-I$(topsrcdir)/dom/interfaces/base']
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/push/nsIDOMPushManager.idl
@@ -0,0 +1,45 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "domstubs.idl"
+interface nsIDOMDOMRequest;
+
+/**
+ * Client API for SimplePush.
+ *
+ * The SimplePush API allows web applications to use push notifications and be
+ * woken up when something of interest has changed. This frees web applications
+ * from implementing polling, giving better responsiveness and conserving the
+ * device's battery life.
+ */
+[scriptable,uuid(c7ad4f42-faae-4e8b-9879-780a72349945)]
+interface nsIDOMPushManager : nsISupports
+{
+  /**
+   * Register for a new push endpoint.
+   *
+   * On success, the DOMRequest's result field will be a string URL.  This URL
+   * is the endpoint that can be contacted to wake up the application.
+   */
+  nsIDOMDOMRequest register();
+  
+  /**
+   * Unregister a push endpoint.
+   *
+   * On success, the DOMRequest's result field will be the endpoint that was
+   * passed in.
+   *
+   * Stops watching for changes to this URL.
+   */
+  nsIDOMDOMRequest unregister(in ACString endpoint);
+
+  /**
+   * Get a list of active registrations for this web app.
+   *
+   * On success, the DOMRequest's result field is an array of endpoints.
+   * For example:
+   *   ["https://example.com/notify/1", "https://example.com/notify/2"]
+   */
+  nsIDOMDOMRequest registrations();
+};
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -22,16 +22,17 @@ interfaces = [
     'xpath',
     'xul',
     'storage',
     'json',
     'offline',
     'geolocation',
     'notification',
     'permission',
+    'push',
     'svg',
     'smil',
     'apps',
     'gamepad',
 ]
 
 PARALLEL_DIRS += ['interfaces/' + i for i in interfaces]
 
--- a/dom/push/src/Push.js
+++ b/dom/push/src/Push.js
@@ -12,32 +12,31 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
 Cu.import("resource://gre/modules/AppsUtils.jsm");
 
-const PUSH_CID = Components.ID("{cde1d019-fad8-4044-b141-65fb4fb7a245}");
+const PUSH_CID = Components.ID("{c7ad4f42-faae-4e8b-9879-780a72349945}");
 
 /**
  * The Push component runs in the child process and exposes the SimplePush API
  * to the web application. The PushService running in the parent process is the
  * one actually performing all operations.
  */
-function Push() {
+function Push()
+{
   debug("Push Constructor");
 }
 
 Push.prototype = {
   __proto__: DOMRequestIpcHelper.prototype,
 
-  contractID: "@mozilla.org/push/PushManager;1",
-
   classID : PUSH_CID,
 
   QueryInterface : XPCOMUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer,
                                           Ci.nsISupportsWeakReference]),
 
   init: function(aWindow) {
     debug("init()");
 
@@ -68,16 +67,26 @@ Push.prototype = {
       "PushService:Registrations:OK",
       "PushService:Registrations:KO"
     ]);
 
     this._cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"]
                    .getService(Ci.nsISyncMessageSender);
 
     var self = this;
+    return {
+      register: self.register.bind(self),
+      unregister: self.unregister.bind(self),
+      registrations: self.registrations.bind(self),
+      __exposedProps__: {
+        register: "r",
+        unregister: "r",
+        registrations: "r"
+      }
+    };
   },
 
   receiveMessage: function(aMessage) {
     debug("receiveMessage()");
     let request = this.getRequest(aMessage.data.requestID);
     let json = aMessage.data;
     if (!request) {
       debug("No request " + json.requestID);
--- a/dom/push/src/Push.manifest
+++ b/dom/push/src/Push.manifest
@@ -1,8 +1,9 @@
 # DOM API
-component {cde1d019-fad8-4044-b141-65fb4fb7a245} Push.js
-contract @mozilla.org/push/PushManager;1 {cde1d019-fad8-4044-b141-65fb4fb7a245}
+component {c7ad4f42-faae-4e8b-9879-780a72349945} Push.js
+contract @mozilla.org/Push;1 {c7ad4f42-faae-4e8b-9879-780a72349945}
+category JavaScript-navigator-property push @mozilla.org/Push;1
 
 # Component to initialize PushService on startup.
 component {4b8caa3b-3c58-4f3c-a7f5-7bd9cb24c11d} PushServiceLauncher.js
-contract @mozilla.org/push/ServiceLauncher;1 {4b8caa3b-3c58-4f3c-a7f5-7bd9cb24c11d}
-category app-startup PushServiceLauncher @mozilla.org/push/ServiceLauncher;1
+contract @mozilla.org/dom/push/service;1 {4b8caa3b-3c58-4f3c-a7f5-7bd9cb24c11d}
+category app-startup PushServiceLauncher @mozilla.org/dom/push/service;1
--- a/dom/push/src/PushServiceLauncher.js
+++ b/dom/push/src/PushServiceLauncher.js
@@ -13,18 +13,16 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 
 function PushServiceLauncher() {
 };
 
 PushServiceLauncher.prototype = {
   classID: Components.ID("{4b8caa3b-3c58-4f3c-a7f5-7bd9cb24c11d}"),
 
-  contractID: "@mozilla.org/push/ServiceLauncher;1",
-
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
 
   observe: function observe(subject, topic, data) {
     switch (topic) {
       case "app-startup":
         Services.obs.addObserver(this, "final-ui-startup", true);
         break;
deleted file mode 100644
--- a/dom/webidl/PushManager.webidl
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/.
-*/
-
-[NavigatorProperty="push", JSImplementation="@mozilla.org/push/PushManager;1"]
-interface PushManager {
-    DOMRequest register();
-    DOMRequest unregister(DOMString pushEndpoint);
-    DOMRequest registrations();
-};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -216,17 +216,16 @@ webidl_files = \
   PerformanceTiming.webidl \
   PeriodicWave.webidl \
   Plugin.webidl \
   PluginArray.webidl \
   Position.webidl \
   PositionError.webidl \
   ProcessingInstruction.webidl \
   Promise.webidl \
-  PushManager.webidl \
   Range.webidl \
   Rect.webidl \
   RGBColor.webidl \
   RTCConfiguration.webidl \
   RTCDataChannelEvent.webidl \
   RTCIceCandidate.webidl \
   RTCPeerConnection.webidl \
   RTCPeerConnectionIceEvent.webidl \