B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * Start tracking a window.
   * This function also initializes the component if it's not already
   * initialized.
   */
Start tracking a window.
This function also initializes the component if it's not already
initialized.
Start tracking a window . This function also initializes the component if it ' s not already initialized .
function ssi_init(aWindow) {
    if (!this._initialized)
      this.initService();
    if (!aWindow || this._loadState == STATE_RUNNING) {
      if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi]))
        this.onLoad(aWindow);
      if (!aWindow && this._loadState == STATE_STOPPED)
        this._loadState = STATE_RUNNING;
      return;
    }
    this.onLoad(aWindow);
  }
function ssi_init ( aWindow ) { if ( ! this . _initialized ) this . initService ( ) ; if ( ! aWindow || this . _loadState == STATE_RUNNING ) { if ( aWindow && ( ! aWindow . __SSi || ! this . _windows [ aWindow . __SSi ] ) ) this . onLoad ( aWindow ) ; if ( ! aWindow && this . _loadState == STATE_STOPPED ) this . _loadState = STATE_RUNNING ; return ; } this . onLoad ( aWindow ) ; }
Start tracking a window.
Start tracking a window .
// Initialize the service if needed. // make sure that all browser windows which try to initialize // SessionStore are really tracked by it // If init is being called with a null window, it's possible that we // just want to tell sessionstore that a session is live (as is the case // with starting Firefox with -private, for example; see bug 568816), // so we should mark the load state as running to make sure that // things like setBrowserState calls will succeed in restoring the session. // As this is called at delayedStartup, restoration must be initiated here