B2G/gecko/dom/messages/SystemMessageInternal.js
// Implementation of the component used by internal users.
Implementation of the component used by internal users.
Implementation of the component used by internal users .
function SystemMessageInternal() {
  this._pages = [];
  this._listeners = {};
  this._webappsRegistryReady = false;
  this._bufferedSysMsgs = [];
  this._cpuWakeLocks = {};
  this._configurators = {};
  Services.obs.addObserver(this, "xpcom-shutdown", false);
  Services.obs.addObserver(this, "webapps-registry-start", false);
  Services.obs.addObserver(this, "webapps-registry-ready", false);
  kMessages.forEach(function(aMsg) {
    ppmm.addMessageListener(aMsg, this);
  }, this);
  Services.obs.notifyObservers(this, "system-message-internal-ready", null);
}
function SystemMessageInternal ( ) { this . _pages = [ ] ; this . _listeners = { } ; this . _webappsRegistryReady = false ; this . _bufferedSysMsgs = [ ] ; this . _cpuWakeLocks = { } ; this . _configurators = { } ; Services . obs . addObserver ( this , "xpcom-shutdown" , false ) ; Services . obs . addObserver ( this , "webapps-registry-start" , false ) ; Services . obs . addObserver ( this , "webapps-registry-ready" , false ) ; kMessages . forEach ( function ( aMsg ) { ppmm . addMessageListener ( aMsg , this ) ; } , this ) ; Services . obs . notifyObservers ( this , "system-message-internal-ready" , null ) ; }
Implementation of the component used by internal users.
Implementation of the component used by internal users .
// The set of pages registered by installed apps. We keep the // list of pending messages for each page here also. // The set of listeners. This is a multi-dimensional object. The _listeners // object itself is a map from manifest ID -> an array mapping proccesses to // windows. We do this so that we can track both what processes we have to // send system messages to as well as supporting the single-process case // where we track windows instead.