B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * On private browsing
   * @param aSubject
   *        Window reference
   * @param aData
   *        String whether to enter or exit private browsing
   */
On private browsing
@param aSubject
Window reference
@param aData
String whether to enter or exit private browsing
On private browsing @param aSubject Window reference @param aData String whether to enter or exit private browsing
function ssi_onPrivateBrowsing(aSubject, aData) {
    switch (aData) {
      case "enter":
        this._inPrivateBrowsing = true;
        break;
      case "exit":
        aSubject.QueryInterface(Ci.nsISupportsPRBool);
        let quitting = aSubject.data;
        if (quitting) {
          if ("_stateBackup" in this) {
            var oState = this._stateBackup;
            oState.session = { state: STATE_STOPPED_STR };
            this._saveStateObject(oState);
          }
        }
        else
          this._inPrivateBrowsing = false;
        delete this._stateBackup;
        break;
    }
    this._clearRestoringWindows();
  }
function ssi_onPrivateBrowsing ( aSubject , aData ) { switch ( aData ) { case "enter" : this . _inPrivateBrowsing = true ; break ; case "exit" : aSubject . QueryInterface ( Ci . nsISupportsPRBool ) ; let quitting = aSubject . data ; if ( quitting ) { if ( "_stateBackup" in this ) { var oState = this . _stateBackup ; oState . session = { state : STATE_STOPPED_STR } ; this . _saveStateObject ( oState ) ; } } else this . _inPrivateBrowsing = false ; delete this . _stateBackup ; break ; } this . _clearRestoringWindows ( ) ; }
On private browsing
 @param aSubject
        Window reference
 @param aData
        String whether to enter or exit private browsing
On private browsing @param aSubject Window reference @param aData String whether to enter or exit private browsing
// save the backed up state with session set to stopped, // otherwise resuming next time would look like a crash. // Whether we restore the session upon resume will be determined by the // usual startup prefs, so we will have the same behavior regardless of // whether the browser was closed while in normal or private browsing mode.