B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * write a state object to disk
   */
write a state object to disk
write a state object to disk
function ssi_saveStateObject(aStateObj) {
    TelemetryStopwatch.start("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
    var stateString = Cc["@mozilla.org/supports-string;1"].
                        createInstance(Ci.nsISupportsString);
    stateString.data = this._toJSONString(aStateObj);
    TelemetryStopwatch.finish("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
    Services.obs.notifyObservers(stateString, "sessionstore-state-write", "");
    if (stateString.data)
      this._writeFile(this._sessionFile, stateString.data);
    this._lastSaveTime = Date.now();
  }
function ssi_saveStateObject ( aStateObj ) { TelemetryStopwatch . start ( "FX_SESSION_RESTORE_SERIALIZE_DATA_MS" ) ; var stateString = Cc [ "@mozilla.org/supports-string;1" ] . createInstance ( Ci . nsISupportsString ) ; stateString . data = this . _toJSONString ( aStateObj ) ; TelemetryStopwatch . finish ( "FX_SESSION_RESTORE_SERIALIZE_DATA_MS" ) ; Services . obs . notifyObservers ( stateString , "sessionstore-state-write" , "" ) ; if ( stateString . data ) this . _writeFile ( this . _sessionFile , stateString . data ) ; this . _lastSaveTime = Date . now ( ) ; }
write a state object to disk
write a state object to disk
// don't touch the file if an observer has deleted all state data