Name Description Size
ContentRestore.sys.mjs This module implements the content side of session restoration. The chrome side is handled by SessionStore.sys.mjs. The functions in this module are called by content-sessionStore.js based on messages received from SessionStore.sys.mjs (or, in one case, based on a "load" event). Each tab has its own ContentRestore instance, constructed by content-sessionStore.js. In a typical restore, content-sessionStore.js will call the following based on messages and events it receives: restoreHistory(tabData, loadArguments, callbacks) Restores the tab's history and session cookies. restoreTabContent(loadArguments, finishCallback) Starts loading the data for the current page to restore. restoreDocument() Restore form and scroll data. When the page has been loaded from the network, we call finishCallback. It should send a message to SessionStore.sys.mjs, which may cause other tabs to be restored. When the page has finished loading, a "load" event will trigger in content-sessionStore.js, which will call restoreDocument. At that point, form data is restored and the restore is complete. At any time, SessionStore.sys.mjs can cancel the ongoing restore by sending a reset message, which causes resetRestore to be called. At that point it's legal to begin another restore. 15549
ContentSessionStore.sys.mjs Listens for and handles content events that we need for the session store service to be notified of state changes in content. 21258
GlobalState.sys.mjs Module that contains global session data. 1850 490 1119
RecentlyClosedTabsAndWindowsMenuUtils.sys.mjs Builds up a document fragment of UI items for the recently closed tabs. @param aWindow The window that the tabs were closed in. @param aTagName The tag name that will be used when creating the UI items. @param aPrefixRestoreAll (defaults to false) Whether the 'restore all tabs' item is suffixed or prefixed to the list. If suffixed (the default) a separator will be inserted before it. @returns A document fragment with UI items for each recently closed tab. 12000
RunState.sys.mjs This module keeps track of SessionStore's current run state. We will always start out at STATE_STOPPED. After the session was read from disk and the initial browser window has loaded we switch to STATE_RUNNING. On the first notice that a browser shutdown was granted we switch to STATE_QUITTING. 3341
SessionCookies.sys.mjs The external API implemented by the SessionCookies module. 7318
SessionFile.sys.mjs Implementation of all the disk I/O required by the session store. This is a private API, meant to be used only by the session store. It will change. Do not use it for any other purpose. Note that this module depends on SessionWriter and that it enqueues its I/O requests and never attempts to simultaneously execute two I/O requests on the files used by this module from two distinct threads. Otherwise, we could encounter bugs, especially under Windows, e.g. if a request attempts to write sessionstore.js while another attempts to copy that file. 15111
SessionMigration.sys.mjs Convert the original session restore state into a minimal state. It will only contain: - open windows - with tabs - with history entries with only title, url, triggeringPrincipal - with pinned state - with tab group info (hidden + group id) - with selected tab info - with selected window info The complete state is then wrapped into the "about:welcomeback" page as form field info to be restored when restoring the state. 3030
SessionSaver.sys.mjs Minimal interval between two save operations (in milliseconds). To save system resources, we generally do not save changes immediately when a change is detected. Rather, we wait a little to see if this change is followed by other changes, in which case only the last write is necessary. This delay is defined by "browser.sessionstore.interval". Furthermore, when the user is not actively using the computer, webpages may still perform changes that require (re)writing to sessionstore, e.g. updating Session Cookies or DOM Session Storage, or refreshing, etc. We expect that these changes are much less critical to the user and do not need to be saved as often. In such cases, we increase the delay to "browser.sessionstore.interval.idle". When the user returns to the computer, if a save is pending, we reschedule it to happen soon, with "browser.sessionstore.interval". 12245
SessionStartup.sys.mjs Session Storage and Restoration Overview This service reads user's session file at startup, and makes a determination as to whether the session should be restored. It will restore the session under the circumstances described below. If the auto-start Private Browsing mode is active, however, the session is never restored. Crash Detection The CrashMonitor is used to check if the final session state was successfully written at shutdown of the last session. If we did not reach 'sessionstore-final-state-write-complete', then it's assumed that the browser has previously crashed and we should restore the session. Forced Restarts In the event that a restart is required due to application update or extension installation, set the browser.sessionstore.resume_session_once pref to true, and the session will be restored the next time the browser starts. Always Resume This service will always resume the session if the integer pref is set to 3. 13543
SessionStore.sys.mjs 257778
SessionWriter.sys.mjs We just started (we haven't written anything to disk yet) from `Paths.clean`. The backup directory may not exist. 12520
StartupPerformance.sys.mjs Once we have finished restoring initial tabs, we broadcast on this topic. 8852
TabAttributes.sys.mjs 1847
TabState.sys.mjs Module that contains tab state collection methods. 6774
TabStateCache.sys.mjs A cache for tabs data. This cache implements a weak map from tabs (as XUL elements) to tab data (as objects). Note that we should never cache private data, as: - that data is used very seldom by SessionStore; - caching private data in addition to public data is memory consuming. 5093
TabStateFlusher.sys.mjs A module that enables async flushes. Updates from frame scripts are throttled to be sent only once per second. If an action wants a tab's latest state without waiting for a second then it can request an async flush and wait until the frame scripts reported back. At this point the parent has the latest data and the action can continue. 8326