Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Backout bug 961861
  • Loading branch information
bill-mccloskey committed Jan 23, 2014
1 parent 67913e8 commit 163ee61
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions browser/components/sessionstore/src/SessionStore.jsm
Expand Up @@ -607,11 +607,6 @@ let SessionStoreInternal = {
receiveMessage: function ssi_receiveMessage(aMessage) {
var browser = aMessage.target;
var win = browser.ownerDocument.defaultView;
let tab = this._getTabForBrowser(browser);
if (!tab) {
// Ignore messages from <browser> elements that are not tabs.
return;
}

switch (aMessage.name) {
case "SessionStore:pageshow":
Expand All @@ -635,6 +630,7 @@ let SessionStoreInternal = {
case "SessionStore:restoreHistoryComplete":
if (this.isCurrentEpoch(browser, aMessage.data.epoch)) {
// Notify the tabbrowser that the tab chrome has been restored.
let tab = this._getTabForBrowser(browser);
let tabData = browser.__SS_data;

// wall-paper fix for bug 439675: make sure that the URL to be loaded
Expand Down Expand Up @@ -685,6 +681,7 @@ let SessionStoreInternal = {
Services.obs.notifyObservers(browser, NOTIFY_TAB_RESTORED, null);
}

let tab = this._getTabForBrowser(browser);
if (tab) {
SessionStoreInternal._resetLocalTabRestoringState(tab);
SessionStoreInternal.restoreNextTab();
Expand All @@ -706,6 +703,7 @@ let SessionStoreInternal = {
break;
case "SessionStore:reloadPendingTab":
if (this.isCurrentEpoch(browser, aMessage.data.epoch)) {
let tab = this._getTabForBrowser(browser);
if (tab && browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE) {
this.restoreTabContent(tab);
}
Expand Down Expand Up @@ -821,12 +819,6 @@ let SessionStoreInternal = {
// internal data about the window.
aWindow.__SSi = this._generateWindowID();

let mm = aWindow.messageManager;
MESSAGES.forEach(msg => mm.addMessageListener(msg, this));

// Load the frame script after registering listeners.
mm.loadFrameScript("chrome://browser/content/content-sessionStore.js", true);

// and create its data object
this._windows[aWindow.__SSi] = { tabs: [], selected: 0, _closedTabs: [], busy: false };

Expand Down Expand Up @@ -1351,6 +1343,12 @@ let SessionStoreInternal = {
let browser = aTab.linkedBrowser;
BROWSER_EVENTS.forEach(msg => browser.addEventListener(msg, this, true));

let mm = browser.messageManager;
MESSAGES.forEach(msg => mm.addMessageListener(msg, this));

// Load the frame script after registering listeners.
mm.loadFrameScript("chrome://browser/content/content-sessionStore.js", false);

if (!aNoNotification) {
this.saveStateDelayed(aWindow);
}
Expand Down

0 comments on commit 163ee61

Please sign in to comment.