Backed out changeset 8477a0eca4fa (bug 1065785)

This commit is contained in:
Wes Kocher 2014-10-20 16:03:40 -07:00
Родитель 005ee607c4
Коммит acb658c47e
3 изменённых файлов: 14 добавлений и 35 удалений

Просмотреть файл

@ -2576,8 +2576,8 @@ let BrowserOnClick = {
TabCrashReporter.submitCrashReport(browser);
}
#endif
let tab = gBrowser.getTabForBrowser(browser);
SessionStore.reviveCrashedTab(tab);
TabCrashReporter.reloadCrashedTab(browser);
}
},

Просмотреть файл

@ -276,10 +276,6 @@ this.SessionStore = {
return SessionStoreInternal.getCurrentState(aUpdateAll);
},
reviveCrashedTab(aTab) {
return SessionStoreInternal.reviveCrashedTab(aTab);
},
/**
* Backstage pass to implementation details, used for testing purpose.
* Controlled by preference "browser.sessionstore.testmode".
@ -1952,35 +1948,6 @@ let SessionStoreInternal = {
LastSession.clear();
},
/**
* Revive a crashed tab and restore its state from before it crashed.
*
* @param aTab
* A <xul:tab> linked to a crashed browser. This is a no-op if the
* browser hasn't actually crashed, or is not associated with a tab.
* This function will also throw if the browser happens to be remote.
*/
reviveCrashedTab(aTab) {
if (!aTab) {
throw new Error("SessionStore.reviveCrashedTab expected a tab, but got null.");
}
let browser = aTab.linkedBrowser;
if (!this._crashedBrowsers.has(browser)) {
return;
}
// Sanity check - the browser to be revived should not be remote
// at this point.
if (browser.isRemoteBrowser) {
throw new Error("SessionStore.reviveCrashedTab: " +
"Somehow a crashed browser is still remote.")
}
let data = TabState.collect(aTab);
this.restoreTab(aTab, data);
},
/**
* See if aWindow is usable for use when restoring a previous session via
* restoreLastSession. If usable, prepare it for use.

Просмотреть файл

@ -87,6 +87,18 @@ this.TabCrashReporter = {
}
},
reloadCrashedTab: function (browser) {
if (browser.isRemoteBrowser)
return;
let doc = browser.contentDocument;
if (!doc.documentURI.startsWith("about:tabcrashed"))
return;
let url = browser.currentURI.spec;
browser.loadURIWithFlags(url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
},
onAboutTabCrashedLoad: function (aBrowser) {
if (!this.childMap)
return;