B2G/gecko/dom/messages/SystemMessageManager.js
// Implementation of the DOM API for system messages
Implementation of the DOM API for system messages
Implementation of the DOM API for system messages
function SystemMessageManager() {
  this._dispatchers = {};
  this._pendings = {};
  this._registerManifestReady = false;
  let appInfo = Cc["@mozilla.org/xre/app-info;1"];
  this._isParentProcess =
    !appInfo || appInfo.getService(Ci.nsIXULRuntime)
                  .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
  if (this._isParentProcess) {
    Services.obs.addObserver(this, kSystemMessageInternalReady, false);
  }
}
function SystemMessageManager ( ) { this . _dispatchers = { } ; this . _pendings = { } ; this . _registerManifestReady = false ; let appInfo = Cc [ "@mozilla.org/xre/app-info;1" ] ; this . _isParentProcess = ! appInfo || appInfo . getService ( Ci . nsIXULRuntime ) . processType == Ci . nsIXULRuntime . PROCESS_TYPE_DEFAULT ; if ( this . _isParentProcess ) { Services . obs . addObserver ( this , kSystemMessageInternalReady , false ) ; } }
Implementation of the DOM API for system messages
Implementation of the DOM API for system messages
// If we have a system message handler registered for messages of type // |type|, this._dispatchers[type] equals {handler, messages, isHandling}, // where //  - |handler| is the message handler that the page registered, //  - |messages| is a list of messages which we've received while //    dispatching messages to the handler, but haven't yet sent, and //  - |isHandling| indicates whether we're currently dispatching messages //    to this handler. // Pending messages for this page, keyed by message type. // Flag to specify if this process has already registered manifest. // Flag to determine this process is a parent or child process. // An oberver to listen to whether the |SystemMessageInternal| is ready.