Name Description Size Coverage
ChromePushSubscription.sys.mjs `ChromePushSubscription` instances are passed to all subscription callbacks. 2503 87 %
components.conf 1127 -
metrics.yaml 3389 -
moz.build 1315 -
Push.manifest 156 -
Push.sys.mjs The Push component runs in the child process and exposes the Push API to the web application. The PushService running in the parent process is the one actually performing all operations. 9544 82 %
PushBroadcastService.sys.mjs Convert the listeners from our on-disk format to the format needed by a hello message. 8695 64 %
PushComponents.sys.mjs This file exports XPCOM components for C++ and chrome JavaScript callers to interact with the Push service. 12969 88 %
PushCrypto.sys.mjs Localized error property names. 25790 95 %
PushDB.sys.mjs @param aRecord The record to be added. 12977 90 %
PushManager.cpp 17594 14 %
PushManager.h PushManager and PushSubscription are exposed on the main and worker threads. The main thread version is implemented in Push.js. The JS implementation makes it easier to use certain APIs like the permission prompt and Promises. Unfortunately, JS-implemented WebIDL is not supported off the main thread. To work around this, we use a chain of runnables to query the JS-implemented nsIPushService component for subscription information, and return the results to the worker. We don't have to deal with permission prompts, since we just reject calls if the principal does not have permission. On the main thread, PushManager wraps a JS-implemented PushManagerImpl instance. The C++ wrapper is necessary because our bindings code cannot accomodate "JS-implemented on the main thread, C++ on the worker" bindings. PushSubscription is in C++ on both threads since it isn't particularly verbose to implement in C++ compared to JS. 4128 100 %
PushNotifier.cpp 11253 82 %
PushNotifier.h `PushDispatcher` is a base class used to forward observer notifications and service worker events to the correct process. 4866 44 %
PushRecord.sys.mjs The push subscription record, stored in IndexedDB. 9376 91 %
PushService.sys.mjs State is change only in couple of functions: init - change state to PUSH_SERVICE_INIT if state was PUSH_SERVICE_UNINIT changeServerURL - change state to PUSH_SERVICE_ACTIVATING if serverURL present or PUSH_SERVICE_INIT if not present. changeStateConnectionEnabledEvent - it is call on pref change or during the service activation and it can change state to PUSH_SERVICE_CONNECTION_DISABLE changeStateOfflineEvent - it is called when offline state changes or during the service activation and it change state to PUSH_SERVICE_ACTIVE_OFFLINE or PUSH_SERVICE_RUNNING. uninit - change state to PUSH_SERVICE_UNINIT. 48715 83 %
PushServiceWebSocket.sys.mjs A proxy between the PushService and the WebSocket. The listener is used so that the PushService can silence messages from the WebSocket by setting PushWebSocketListener._pushService to null. This is required because a WebSocket can continue to send messages or errors after it has been closed but the PushService may not be interested in these. It's easier to stop listening than to have checks at specific points. 38241 79 %
PushSubscription.cpp 10680 36 %
PushSubscription.h 2468 75 %
PushSubscriptionOptions.cpp 2071 56 %
PushSubscriptionOptions.h 1537 50 %
test -