Bug 1001120 - Remove the frame tree observer from the content-sessionStore.js SessionHistoryListener. r=ttaubert
☠☠ backed out by fd7ac192e4d8 ☠ ☠
authorSteven MacLeod <smacleod@mozilla.com>
Mon, 28 Apr 2014 12:04:00 -0400
changeset 181124 a2d961fb47899c1c9d64313e5f8ec9969cecb027
parent 181123 f92e1b127fe802892ca12c4d9eb41fab3b6da3a6
child 181125 fba7df3807b31bf45bcfe5221d366d7b13a3432d
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersttaubert
bugs1001120
milestone31.0a1
Bug 1001120 - Remove the frame tree observer from the content-sessionStore.js SessionHistoryListener. r=ttaubert
browser/components/sessionstore/content/content-sessionStore.js
browser/components/sessionstore/test/browser_sessionHistory.js
--- a/browser/components/sessionstore/content/content-sessionStore.js
+++ b/browser/components/sessionstore/content/content-sessionStore.js
@@ -210,23 +210,16 @@ let SyncHandler = {
  * Causes a SessionStore:update message to be sent that contains the current
  * session history.
  *
  * Example:
  *   {entries: [{url: "about:mozilla", ...}, ...], index: 1}
  */
 let SessionHistoryListener = {
   init: function () {
-    // The frame tree observer is needed to handle navigating away from
-    // an about page. Currently nsISHistoryListener does not have
-    // OnHistoryNewEntry() called for about pages because the history entry is
-    // modified to point at the new page. Once Bug 981900 lands the frame tree
-    // observer can be removed.
-    gFrameTree.addObserver(this);
-
     // By adding the SHistoryListener immediately, we will unfortunately be
     // notified of every history entry as the tab is restored. We don't bother
     // waiting to add the listener later because these notifications are cheap.
     // We will likely only collect once since we are batching collection on
     // a delay.
     docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory.
       addSHistoryListener(this);
 
@@ -244,24 +237,16 @@ let SessionHistoryListener = {
   },
 
   collect: function () {
     if (docShell) {
       MessageQueue.push("history", () => SessionHistory.collect(docShell));
     }
   },
 
-  onFrameTreeCollected: function () {
-    this.collect();
-  },
-
-  onFrameTreeReset: function () {
-    this.collect();
-  },
-
   OnHistoryNewEntry: function (newURI) {
     this.collect();
   },
 
   OnHistoryGoBack: function (backURI) {
     this.collect();
     return true;
   },
--- a/browser/components/sessionstore/test/browser_sessionHistory.js
+++ b/browser/components/sessionstore/test/browser_sessionHistory.js
@@ -214,17 +214,16 @@ add_task(function test_pushstate_replace
   yield promiseContentMessage(browser, "ss-test:historyPushState");
 
   // Check that we have added the history entry.
   SyncHandlers.get(browser).flush();
   let {entries} = JSON.parse(ss.getTabState(tab));
   is(entries.length, 2, "there is another shistory entry");
   is(entries[1].url, "http://example.com/test-entry/", "url is correct");
 
-  // Disabled until replaceState invalidation is supported. See Bug 967028.
   browser.messageManager.
     sendAsyncMessage("ss-test:historyReplaceState", {url: 'test-entry2/'});
   yield promiseContentMessage(browser, "ss-test:historyReplaceState");
 
   // Check that we have modified the history entry.
   SyncHandlers.get(browser).flush();
   let {entries} = JSON.parse(ss.getTabState(tab));
   is(entries.length, 2, "there is still two shistory entries");