summaryrefslogtreecommitdiffstats
path: root/dom/interfaces/push/nsIPushErrorReporter.idl
diff options
context:
space:
mode:
Diffstat (limited to 'dom/interfaces/push/nsIPushErrorReporter.idl')
-rw-r--r--dom/interfaces/push/nsIPushErrorReporter.idl45
1 files changed, 45 insertions, 0 deletions
diff --git a/dom/interfaces/push/nsIPushErrorReporter.idl b/dom/interfaces/push/nsIPushErrorReporter.idl
new file mode 100644
index 000000000..d9cef82ea
--- /dev/null
+++ b/dom/interfaces/push/nsIPushErrorReporter.idl
@@ -0,0 +1,45 @@
+/* -*- 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/. */
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(b58249f9-1a04-48cc-bc20-2c992d64c73e)]
+interface nsIPushErrorReporter : nsISupports
+{
+ /**
+ * Ack types, reported when the Push service acknowledges an incoming message.
+ *
+ * Acks are sent before the message is dispatched to the service worker,
+ * since the server delays new messages until all outstanding ones have been
+ * acked. |reportDeliveryError| will be called if an error occurs in the
+ * worker's `push` event handler after acking the message.
+ */
+ const uint16_t ACK_DELIVERED = 0;
+ const uint16_t ACK_DECRYPTION_ERROR = 1;
+ const uint16_t ACK_NOT_DELIVERED = 2;
+
+ /**
+ * Unsubscribe reasons, reported when the service drops a subscription.
+ */
+ const uint16_t UNSUBSCRIBE_MANUAL = 3;
+ const uint16_t UNSUBSCRIBE_QUOTA_EXCEEDED = 4;
+ const uint16_t UNSUBSCRIBE_PERMISSION_REVOKED = 5;
+
+ /**
+ * Delivery error reasons, reported when a service worker fails to handle
+ * an incoming push message in its `push` event handler.
+ */
+ const uint16_t DELIVERY_UNCAUGHT_EXCEPTION = 6;
+ const uint16_t DELIVERY_UNHANDLED_REJECTION = 7;
+ const uint16_t DELIVERY_INTERNAL_ERROR = 8;
+
+ /**
+ * Reports a `push` event handler error to the Push service. |messageId| is
+ * an opaque string passed to `nsIPushNotifier.notifyPush{WithData}`.
+ * |reason| is a delivery error reason.
+ */
+ void reportDeliveryError(in DOMString messageId,
+ [optional] in uint16_t reason);
+};