Bug 867142 - Remove browser.__SS_restoreState and use a WeakMap instead; r=yoric

This commit is contained in:
Tim Taubert
2013-05-21 15:02:46 +02:00
parent 07e274bad2
commit 9c7a47b447
8 changed files with 98 additions and 117 deletions

View File

@@ -1,6 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
let tmp = {};
Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
let SessionStore = tmp.SessionStore;
// Some tests here assume that all restored tabs are loaded without waiting for
// the user to bring them to the foreground. We ensure this by resetting the
// related preference (see the "firefox.js" defaults file for details).
@@ -117,8 +121,6 @@ function newWindowWithTabView(shownCallback, loadCallback, width, height) {
// ----------
function afterAllTabsLoaded(callback, win) {
const TAB_STATE_NEEDS_RESTORE = 1;
win = win || window;
let stillToLoad = 0;
@@ -137,8 +139,7 @@ function afterAllTabsLoaded(callback, win) {
let browser = tab.linkedBrowser;
let isRestorable = !(tab.hidden && !restoreHiddenTabs &&
browser.__SS_restoreState &&
browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE);
SessionStore.isTabStateNeedsRestore(browser));
if (isRestorable && browser.contentDocument.readyState != "complete" ||
browser.webProgress.isLoadingDocument) {