diff --git a/browser/components/sessionstore/ContentRestore.jsm b/browser/components/sessionstore/ContentRestore.jsm index 85f31e407838..7d68e36a1ac8 100644 --- a/browser/components/sessionstore/ContentRestore.jsm +++ b/browser/components/sessionstore/ContentRestore.jsm @@ -136,7 +136,11 @@ ContentRestoreInternal.prototype = { SessionHistory.restore(this.docShell, tabData); // Add a listener to watch for reloads. - let listener = new HistoryListener(this.docShell, callbacks.onReload); + let listener = new HistoryListener(this.docShell, () => { + // On reload, restore tab contents. + this.restoreTabContent(null, callbacks.onLoadFinished); + }); + webNavigation.sessionHistory.addSHistoryListener(listener); this._historyListener = listener; diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 4bbfeb6898b0..65a145f1dd0f 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -66,10 +66,6 @@ const MESSAGES = [ // SSTabRestored at this time. "SessionStore:restoreTabContentComplete", - // A tab that is being restored was reloaded. We call restoreTabContent to - // finish restoring it right away. - "SessionStore:reloadPendingTab", - // A crashed tab was revived by navigating to a different page. Remove its // browser from the list of crashed browsers to stop ignoring its messages. "SessionStore:crashedTabRevived", @@ -769,11 +765,6 @@ let SessionStoreInternal = { this._sendTabRestoredNotification(tab); break; - case "SessionStore:reloadPendingTab": - if (browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE) { - this.restoreTabContent(tab); - } - break; case "SessionStore:crashedTabRevived": this._crashedBrowsers.delete(browser.permanentKey); break; diff --git a/browser/components/sessionstore/content/content-sessionStore.js b/browser/components/sessionstore/content/content-sessionStore.js index b0c24237e99f..19f453c6ed2c 100644 --- a/browser/components/sessionstore/content/content-sessionStore.js +++ b/browser/components/sessionstore/content/content-sessionStore.js @@ -149,15 +149,10 @@ let MessageListener = { restoreHistory({epoch, tabData, loadArguments}) { gContentRestore.restoreHistory(tabData, loadArguments, { - onReload() { - // Inform SessionStore.jsm about the reload. It will send - // restoreTabContent in response. - sendAsyncMessage("SessionStore:reloadPendingTab", {epoch}); - }, - - // Note: The two callbacks passed here will only be used when a load - // starts that was not initiated by sessionstore itself. This can happen - // when some code calls browser.loadURI() on a pending browser/tab. + // Note: The callbacks passed here will only be used when a load starts + // that was not initiated by sessionstore itself. This can happen when + // some code calls browser.loadURI() or browser.reload() on a pending + // browser/tab. onLoadStarted() { // Notify the parent that the tab is no longer pending.