Backed out changeset 0172497c1024 (bug 1337940)
authorIris Hsiao <ihsiao@mozilla.com>
Wed, 22 Feb 2017 16:16:10 +0800
changeset 344138 9a9db410f20781076424307265decbc5de1e94cc
parent 344137 c53368e7d1a342ea7ea6e9858b78674319d6f37c
child 344139 41ee7e93b5cb9a4c43c5cdd1dcf59c47fc324d3e
child 344226 13a54cc4d8be58afabb3078c6ba5f4241dd396f4
push id37763
push userihsiao@mozilla.com
push dateWed, 22 Feb 2017 08:18:07 +0000
treeherderautoland@41ee7e93b5cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1337940
milestone54.0a1
backs out0172497c1024e8ed758e6aea7bb5d87ca8aec6e5
first release with
nightly linux32
9a9db410f207 / 54.0a1 / 20170222110216 / files
nightly linux64
9a9db410f207 / 54.0a1 / 20170222110216 / files
nightly mac
9a9db410f207 / 54.0a1 / 20170222030329 / files
nightly win32
9a9db410f207 / 54.0a1 / 20170222030329 / files
nightly win64
9a9db410f207 / 54.0a1 / 20170222030329 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 0172497c1024 (bug 1337940)
mobile/android/chrome/content/browser.js
mobile/android/components/SessionStore.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4535,51 +4535,49 @@ Tab.prototype = {
     return null;
   },
 
   _updateZoomFromHistoryEvent: function(aHistoryEventName) {
     // Restore zoom only when moving in session history, not for new page loads.
     this._restoreZoom = aHistoryEventName !== "New";
   },
 
-  OnHistoryNewEntry: function(newURI, oldIndex) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryNewEntry: function(aUri) {
     this._updateZoomFromHistoryEvent("New");
   },
 
-  OnHistoryGoBack: function(backURI) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryGoBack: function(aUri) {
     this._updateZoomFromHistoryEvent("Back");
     return true;
   },
 
-  OnHistoryGoForward: function(forwardURI) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryGoForward: function(aUri) {
     this._updateZoomFromHistoryEvent("Forward");
     return true;
   },
 
-  OnHistoryReload: function(reloadURI, reloadFlags) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryReload: function(aUri, aFlags) {
+    // we don't do anything with this, so don't propagate it
+    // for now anyway
     return true;
   },
 
-  OnHistoryGotoIndex: function(index, gotoURI) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryGotoIndex: function(aIndex, aUri) {
     this._updateZoomFromHistoryEvent("Goto");
     return true;
   },
 
-  OnHistoryPurge: function(numEntries) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryPurge: function(aNumEntries) {
+    this._updateZoomFromHistoryEvent("Purge");
     return true;
   },
 
-  OnHistoryReplaceEntry: function(index) {
-    Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
+  OnHistoryReplaceEntry: function(aIndex) {
+    // we don't do anything with this, so don't propogate it
+    // for now anyway.
   },
 
   ShouldNotifyMediaPlaybackChange: function(inactive) {
     // We don't want to show the media control interface for the short sound
     // which duration is smaller than the threshold. The basic unit is second.
     // Note : the streaming format's duration is infinite.
     const mediaDurationThreshold = 1.0;
 
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -178,17 +178,16 @@ SessionStore.prototype = {
         observerService.addObserver(this, "domwindowclosed", true);
         observerService.addObserver(this, "browser:purge-session-history", true);
         observerService.addObserver(this, "browser:purge-session-tabs", true);
         observerService.addObserver(this, "quit-application-requested", true);
         observerService.addObserver(this, "quit-application-proceeding", true);
         observerService.addObserver(this, "quit-application", true);
         observerService.addObserver(this, "Session:Restore", true);
         observerService.addObserver(this, "Session:NotifyLocationChange", true);
-        observerService.addObserver(this, "Content:HistoryChange", true);
         observerService.addObserver(this, "Tab:KeepZombified", true);
         observerService.addObserver(this, "application-background", true);
         observerService.addObserver(this, "application-foreground", true);
         observerService.addObserver(this, "ClosedTabs:StartNotifications", true);
         observerService.addObserver(this, "ClosedTabs:StopNotifications", true);
         observerService.addObserver(this, "last-pb-context-exited", true);
         observerService.addObserver(this, "Session:RestoreRecentTabs", true);
         observerService.addObserver(this, "Tabs:OpenMultiple", true);
@@ -309,37 +308,16 @@ SessionStore.prototype = {
         }
 
         if (browser.__SS_restoreDataOnLocationChange) {
           delete browser.__SS_restoreDataOnLocationChange;
           this._restoreZoom(browser.__SS_data.scrolldata, browser);
         }
         break;
       }
-      case "Content:HistoryChange": {
-        let browser = aSubject;
-        let window = browser.ownerGlobal;
-        log("Content:HistoryChange for tab " + window.BrowserApp.getTabForBrowser(browser).id);
-        // We want to ignore history changes which we caused ourselves when
-        // restoring the history of a delay-loaded tab.
-        if (!browser.__SS_restore && !browser.__SS_restoreReloadPending) {
-          // The OnHistory... notifications are called *before* the history changes
-          // are persisted. We therefore need to make our onTabLoad call async,
-          // so it can actually capture the new session history state.
-          if (browser.__SS_historyChange) {
-            window.clearTimeout(browser.__SS_historyChange);
-          }
-          browser.__SS_historyChange =
-            window.setTimeout(() => {
-              delete browser.__SS_historyChange;
-              this.onTabLoad(window, browser);
-            }, 0);
-        }
-        break;
-      }
       case "Tabs:OpenMultiple": {
         let data = JSON.parse(aData);
 
         this._openTabs(data);
 
         if (data.shouldNotifyTabsOpenedToJava) {
           let window = Services.wm.getMostRecentWindow("navigator:browser");
           window.WindowEventDispatcher.sendRequest({
@@ -636,21 +614,16 @@ SessionStore.prototype = {
     aBrowser.removeEventListener("pageshow", this, true);
     aBrowser.removeEventListener("AboutReaderContentReady", this, true);
     aBrowser.removeEventListener("change", this, true);
     aBrowser.removeEventListener("input", this, true);
     aBrowser.removeEventListener("DOMAutoComplete", this, true);
     aBrowser.removeEventListener("scroll", this, true);
     aBrowser.removeEventListener("resize", this, true);
 
-    if (aBrowser.__SS_historyChange) {
-      aWindow.clearTimeout(aBrowser.__SS_historyChange);
-      delete aBrowser.__SS_historyChange;
-    }
-
     delete aBrowser.__SS_data;
 
     log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
         ", aNoNotification = " + aNoNotification);
     if (!aNoNotification) {
       this.saveStateDelayed();
     }
   },
@@ -1661,22 +1634,22 @@ SessionStore.prototype = {
       if (parentId > -1) {
         tab.parentId = parentId;
       }
 
       tab.browser.__SS_data = tabData;
       tab.browser.__SS_extdata = tabData.extData;
 
       if (window.BrowserApp.selectedTab == tab) {
-        // After we're done restoring, we can lift the general ban on tab data
-        // capturing, but we still need to protect the foreground tab until we're
+        this._restoreTab(tabData, tab.browser);
+
+        // We can now lift the general ban on tab data capturing,
+        // but we still need to protect the foreground tab until we're
         // sure it's actually reloading after history restoring has finished.
         tab.browser.__SS_restoreReloadPending = true;
-
-        this._restoreTab(tabData, tab.browser);
         this._startupRestoreFinished = true;
         log("startupRestoreFinished = true");
 
         delete tab.browser.__SS_restore;
         tab.browser.removeAttribute("pending");
       } else {
         // Mark the browser for delay loading
         tab.browser.__SS_restore = true;