Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 /**
8 * Session Storage and Restoration
9 *
10 * Overview
11 * This service keeps track of a user's session, storing the various bits
12 * required to return the browser to its current state. The relevant data is
13 * stored in memory, and is periodically saved to disk in a file in the
14 * profile directory. The service is started at first window load, in
15 * delayedStartup, and will restore the session from the data received from
16 * the nsSessionStartup service.
17 */
19 const Cu = Components.utils;
20 const Ci = Components.interfaces;
22 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
23 Cu.import("resource:///modules/sessionstore/SessionStore.jsm");
25 function SessionStoreService() {}
27 // The SessionStore module's object is frozen. We need to modify our prototype
28 // and add some properties so let's just copy the SessionStore object.
29 Object.keys(SessionStore).forEach(function (aName) {
30 let desc = Object.getOwnPropertyDescriptor(SessionStore, aName);
31 Object.defineProperty(SessionStoreService.prototype, aName, desc);
32 });
34 SessionStoreService.prototype.classID =
35 Components.ID("{5280606b-2510-4fe0-97ef-9b5a22eafe6b}");
36 SessionStoreService.prototype.QueryInterface =
37 XPCOMUtils.generateQI([Ci.nsISessionStore]);
39 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]);