Backed out changeset 675ea8aeb804 (bug 884897) for breaking builds on a CLOSED TREE

This commit is contained in:
Wes Kocher 2013-07-30 15:31:10 -07:00
parent 02d1dbe0d8
commit 9bbd0a74e3
8 changed files with 73 additions and 23 deletions

View File

@ -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']

View File

@ -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();
};

View File

@ -27,6 +27,7 @@ interfaces = [
'geolocation',
'notification',
'permission',
'push',
'svg',
'smil',
'apps',

View File

@ -17,22 +17,21 @@ 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,
@ -73,6 +72,16 @@ Push.prototype = {
.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) {

View File

@ -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

View File

@ -18,8 +18,6 @@ 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]),

View File

@ -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();
};

View File

@ -221,7 +221,6 @@ webidl_files = \
PositionError.webidl \
ProcessingInstruction.webidl \
Promise.webidl \
PushManager.webidl \
Range.webidl \
Rect.webidl \
RGBColor.webidl \