зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1169892 - Avoid extra round-trip when a pending tab is reloaded r=billm
This commit is contained in:
Родитель
1d622f38f2
Коммит
cfc376cc2c
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче