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.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | /** |
michael@0 | 8 | * nsISessionStore keeps track of the current browsing state - i.e. |
michael@0 | 9 | * tab history, cookies, scroll state, form data, and window features |
michael@0 | 10 | * - and allows to restore everything into one window. |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(934697e4-3807-47f8-b6c9-6caa8d83ccd1)] |
michael@0 | 14 | interface nsISessionStartup: nsISupports |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * Return a promise that is resolved once initialization |
michael@0 | 18 | * is complete. |
michael@0 | 19 | */ |
michael@0 | 20 | readonly attribute jsval onceInitialized; |
michael@0 | 21 | |
michael@0 | 22 | // Get session state |
michael@0 | 23 | readonly attribute jsval state; |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Determines whether there is a pending session restore. Should only be |
michael@0 | 27 | * called after initialization has completed. |
michael@0 | 28 | */ |
michael@0 | 29 | boolean doRestore(); |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Determines whether automatic session restoration is enabled for this |
michael@0 | 33 | * launch of the browser. This does not include crash restoration, and will |
michael@0 | 34 | * return false if restoration will only be caused by a crash. |
michael@0 | 35 | */ |
michael@0 | 36 | boolean isAutomaticRestoreEnabled(); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Returns whether we will restore a session that ends up replacing the |
michael@0 | 40 | * homepage. The browser uses this to not start loading the homepage if |
michael@0 | 41 | * we're going to stop its load anyway shortly after. |
michael@0 | 42 | * |
michael@0 | 43 | * This is meant to be an optimization for the average case that loading the |
michael@0 | 44 | * session file finishes before we may want to start loading the default |
michael@0 | 45 | * homepage. Should this be called before the session file has been read it |
michael@0 | 46 | * will just return false. |
michael@0 | 47 | */ |
michael@0 | 48 | readonly attribute bool willOverrideHomepage; |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * What type of session we're restoring. |
michael@0 | 52 | * NO_SESSION There is no data available from the previous session |
michael@0 | 53 | * RECOVER_SESSION The last session crashed. It will either be restored or |
michael@0 | 54 | * about:sessionrestore will be shown. |
michael@0 | 55 | * RESUME_SESSION The previous session should be restored at startup |
michael@0 | 56 | * DEFER_SESSION The previous session is fine, but it shouldn't be restored |
michael@0 | 57 | * without explicit action (with the exception of pinned tabs) |
michael@0 | 58 | */ |
michael@0 | 59 | const unsigned long NO_SESSION = 0; |
michael@0 | 60 | const unsigned long RECOVER_SESSION = 1; |
michael@0 | 61 | const unsigned long RESUME_SESSION = 2; |
michael@0 | 62 | const unsigned long DEFER_SESSION = 3; |
michael@0 | 63 | |
michael@0 | 64 | readonly attribute unsigned long sessionType; |
michael@0 | 65 | readonly attribute bool previousSessionCrashed; |
michael@0 | 66 | }; |