Struct xpcom::interfaces::nsIPushService [] [src]

#[repr(C)]
pub struct nsIPushService { /* fields omitted */ }

interface nsIPushService : nsISupports

/**
 * A service for components to subscribe and receive push messages from web
 * services. This functionality is exposed to content via the Push DOM API,
 * which uses service workers. This interface exists to support the DOM API,
 * and allows privileged code to receive messages without migrating to service
 * workers.
 */

Methods

impl nsIPushService
[src]

[src]

Cast this nsIPushService to one of its base interfaces.

impl nsIPushService
[src]

[src]

/** Observer topic names, exported for convenience. */

readonly attribute DOMString pushTopic;

[src]

readonly attribute DOMString subscriptionChangeTopic;

[src]

readonly attribute DOMString subscriptionModifiedTopic;

[src]

/**
   * Creates a push subscription for the given |scope| URL and |principal|.
   * If a subscription already exists for this |(scope, principal)| pair,
   * the callback will receive the existing record as the second argument.
   *
   * The |endpoint| property of the subscription record is a URL string
   * that can be used to send push messages to subscribers.
   *
   * Each incoming message fires a `push-message` observer notification, with
   * an `nsIPushMessage` as the subject and the |scope| as the data.
   *
   * If the server drops a subscription, a `push-subscription-change` observer
   * will be fired, with the subject set to |principal| and the data set to
   * |scope|. Servers may drop subscriptions at any time, so callers should
   * recreate subscriptions if desired.
   */

void subscribe (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback);

[src]

/**
   * Creates a restricted push subscription with the given public |key|. The
   * application server must use the corresponding private key to authenticate
   * message delivery requests, as described in draft-thomson-webpush-vapid.
   */

void subscribeWithKey (in DOMString scope, in nsIPrincipal principal, in uint32_t keyLength, [array, size_is (keyLength), const] in uint8_t key, in nsIPushSubscriptionCallback callback);

[src]

/**
   * Removes a push subscription for the given |scope|.
   */

void unsubscribe (in DOMString scope, in nsIPrincipal principal, in nsIUnsubscribeResultCallback callback);

[src]

/**
   * Retrieves the subscription record associated with the given
   * |(scope, principal)| pair. If the subscription does not exist, the
   * callback will receive |null| as the second argument.
   */

void getSubscription (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback);

[src]

/**
   * Drops every subscription for the given |domain|, or all domains if
   * |domain| is "*".
   */

void clearForDomain (in DOMString domain, in nsIPushClearResultCallback callback);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIPushService
[src]

IID: nsIID = nsID(1737422212, 48933, 18346, [172, 132, 3, 239, 192, 134, 91, 104])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIPushService
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIPushService
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.