Bug 1492950 - Move ZoomManager reset for crashed tabs into ContentCrashHandlers.jsm. r=Felipe
authorMike Conley <mconley@mozilla.com>
Tue, 02 Oct 2018 17:50:09 +0000
changeset 494950 00a4cf01fa97c64d7935533eff8b12a8b5ce6907
parent 494949 193cb0e601503e08540a5c52a723bfb088e0e2e3
child 494951 bb9fc6495914b7176ce399f76df39caf2ba78472
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1492950
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492950 - Move ZoomManager reset for crashed tabs into ContentCrashHandlers.jsm. r=Felipe Depends on D6706 Differential Revision: https://phabricator.services.mozilla.com/D6709
browser/base/content/browser.js
browser/modules/ContentCrashHandlers.jsm
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1437,28 +1437,16 @@ var gBrowserInit = {
     TelemetryTimestamps.add("delayedStartupStarted");
 
     this._cancelDelayedStartup();
 
     // We need to set the OfflineApps message listeners up before we
     // load homepages, which might need them.
     OfflineApps.init();
 
-    gBrowser.addEventListener("AboutTabCrashedLoad", function(event) {
-      let ownerDoc = event.originalTarget;
-
-      if (!ownerDoc.documentURI.startsWith("about:tabcrashed")) {
-        return;
-      }
-
-      let browser = gBrowser.getBrowserForDocument(event.target);
-      // Reset the zoom for the tabcrashed page.
-      ZoomManager.setZoomForBrowser(browser, 1);
-    }, false, true);
-
     gBrowser.addEventListener("InsecureLoginFormsStateChange", function() {
       gIdentityHandler.refreshForInsecureLoginForms();
     }, true);
 
     gBrowser.addEventListener("PermissionStateChange", function() {
       gIdentityHandler.refreshIdentityBlock();
     }, true);
 
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -490,16 +490,20 @@ var TabCrashHandler = {
     // how many about:tabcrashed pages exist, so that they
     // can decide whether or not to display the "Restore All
     // Crashed Tabs" button.
     this.pageListener.sendAsyncMessage("UpdateCount", {
       count: this._crashedTabCount,
     });
 
     let browser = message.target.browser;
+    let window = browser.ownerGlobal;
+
+    // Reset the zoom for the tabcrashed page.
+    window.ZoomManager.setZoomForBrowser(browser, 1);
 
     let childID = this.browserMap.get(browser);
     let index = this.unseenCrashedChildIDs.indexOf(childID);
     if (index != -1) {
       this.unseenCrashedChildIDs.splice(index, 1);
     }
 
     let dumpID = this.getDumpID(browser);