Bug 822712 - SimplePush - Interface. r=dougt, sr=sicking

This commit is contained in:
Doug Turner 2013-03-28 20:49:41 -07:00
parent e595af5617
commit 872d72080e
2 changed files with 54 additions and 0 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();
};