B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * On quitting application
   * @param aData
   *        String type of quitting
   */
On quitting application
@param aData
String type of quitting
On quitting application @param aData String type of quitting
function ssi_onQuitApplication(aData) {
    if (aData == "restart") {
      this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
      Services.obs.removeObserver(this, "browser:purge-session-history");
    }
    else if (this._resume_session_once_on_shutdown != null) {
      this._prefBranch.setBoolPref("sessionstore.resume_session_once",
                                   this._resume_session_once_on_shutdown);
    }
    if (aData != "restart") {
      this._lastSessionState = null;
    }
    this._loadState = STATE_QUITTING; 
    this._uninit();
  }
function ssi_onQuitApplication ( aData ) { if ( aData == "restart" ) { this . _prefBranch . setBoolPref ( "sessionstore.resume_session_once" , true ) ; Services . obs . removeObserver ( this , "browser:purge-session-history" ) ; } else if ( this . _resume_session_once_on_shutdown != null ) { this . _prefBranch . setBoolPref ( "sessionstore.resume_session_once" , this . _resume_session_once_on_shutdown ) ; } if ( aData != "restart" ) { this . _lastSessionState = null ; } this . _loadState = STATE_QUITTING ; this . _uninit ( ) ; }
On quitting application
 @param aData
        String type of quitting
On quitting application @param aData String type of quitting
// The browser:purge-session-history notification fires after the // quit-application notification so unregister the // browser:purge-session-history notification to prevent clearing // session data on disk on a restart.  It is also unnecessary to // perform any other sanitization processing on a restart as the // browser is about to exit anyway. // if the sessionstore.resume_session_once preference was changed by // saveState because crash recovery is disabled then restore the // preference back to the value it was prior to that.  This will prevent // SessionStore from always restoring the session when crash recovery is // disabled. // Throw away the previous session on shutdown // just to be sure