nsSessionStartup - /* /@line 38

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/* //@line 38 "e:\builds\moz2_slave\win32_build\build\browser\components\sessionstore\ src\nsSessionStartup.js" */ /** //@line 65 "e:\builds\moz2_slave\win32_build\build\browser\components\sessionstore\ src\nsSessionStartup.js" */ /* :::::::: Constants and Helpers ::::::::::::::: */ const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const STATE_RUNNING_STR = "running"; function debug(aMsg) { aMsg = ("SessionStartup: " + aMsg).replace(/\S{80}/g, "$&\n"); Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService) .logStringMessage(aMsg); } /* :::::::: The Service ::::::::::::::: */ function SessionStartup() { } SessionStartup.prototype = { // the state to restore at startup _iniString: null, _sessionType: Ci.nsISessionStartup.NO_SESSION, /* . ....... Global Event Handlers . ............. */ /** * Initialize the component */ init: function sss_init() { // do not need to initialize anything in auto-started private browsing sessions let pbs = Cc["@mozilla.org/privatebrowsing;1"]. getService(Ci.nsIPrivateBrowsingService); if (pbs.autoStarted) return; let prefBranch = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefService).getBranch("browser."); // get file references var dirService = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); let sessionFile = dirService.get("ProfD", Ci.nsILocalFile); sessionFile.append("sessionstore.js"); let doResumeSession = prefBranch.getBoolPref("sessionstore.resume_session_once") ||
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
prefBranch.getIntPref("startup.page") == 3; // only read the session file if config allows possibility of restoring var resumeFromCrash = prefBranch.getBoolPref("sessionstore.resume_from_crash"); return; // get string containing session state this._iniString = this._readStateFile(sessionFile);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

nsSessionStartup - /* /@line 38

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online