Bug 928367 - Preload ErrorPage.js in dom/ipc/preload.js. r=fabrice
authorVivien Nicolas <21@vingtetun.org>
Sat, 19 Oct 2013 12:30:32 +0200
changeset 166194 64ad24d86f5952a612eb5c8e095f11e0bbd2c83a
parent 166193 dc2b71e57211b1a71f17937aa3da729d5ecf4426
child 166195 f45b84411aae6782cf7c5d56033e7c79e11d68ee
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs928367
milestone27.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 928367 - Preload ErrorPage.js in dom/ipc/preload.js. r=fabrice
b2g/components/ErrorPage.jsm
dom/browser-element/BrowserElementChild.js
dom/ipc/preload.js
--- a/b2g/components/ErrorPage.jsm
+++ b/b2g/components/ErrorPage.jsm
@@ -152,18 +152,22 @@ let ErrorPage = {
   init: function errorPageInit() {
     Services.obs.addObserver(this, 'in-process-browser-or-app-frame-shown', false);
     Services.obs.addObserver(this, 'remote-browser-frame-shown', false);
   },
 
   observe: function errorPageObserve(aSubject, aTopic, aData) {
     let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
     let mm = frameLoader.messageManager;
+
+    // This won't happen from dom/ipc/preload.js in non-OOP builds.
     try {
-      mm.loadFrameScript(kErrorPageFrameScript, true);
+      if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) {
+        mm.loadFrameScript(kErrorPageFrameScript, true);
+      }
     } catch (e) {
       dump('Error loading ' + kErrorPageFrameScript + ' as frame script: ' + e + '\n');
     }
     mm.addMessageListener('ErrorPage:AddCertException', this._addCertException.bind(this));
   }
 };
 
 ErrorPage.init();
--- a/dom/browser-element/BrowserElementChild.js
+++ b/dom/browser-element/BrowserElementChild.js
@@ -19,18 +19,19 @@ docShell.isActive = true;
 
 let infos = sendSyncMessage('browser-element-api:call',
                             { 'msg_name': 'hello' })[0];
 docShell.QueryInterface(Ci.nsIDocShellTreeItem).name = infos.name;
 docShell.setFullscreenAllowed(infos.fullscreenAllowed);
 
 
 if (!('BrowserElementIsPreloaded' in this)) {
-  // This is a produc-specific file that's sometimes unavailable.
+  // Those are produc-specific files that's sometimes unavailable.
   try {
     Services.scriptloader.loadSubScript("chrome://browser/content/forms.js");
+    Services.scriptloader.loadSubScript("chrome://browser/content/ErrorPage.js");
   } catch (e) {
   }
   Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementPanning.js");
   Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementChildPreload.js");
 }
 
 var BrowserElementIsReady = true;
--- a/dom/ipc/preload.js
+++ b/dom/ipc/preload.js
@@ -86,19 +86,20 @@ const BrowserElementIsPreloaded = true;
 
   try {
     if (Services.prefs.getBoolPref("dom.sysmsg.enabled")) {
       Cc["@mozilla.org/system-message-manager;1"].getService(Ci["nsIDOMNavigatorSystemMessages"]);
     }
   } catch(e) {
   }
 
-  // This is a produc-specific file that's sometimes unavailable.
+  // Those are produc-specific files that's sometimes unavailable.
   try {
     Services.scriptloader.loadSubScript("chrome://browser/content/forms.js", global);
+    Services.scriptloader.loadSubScript("chrome://browser/content/ErrorPage.js", global);
   } catch (e) {
   }
   Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementPanning.js", global);
   Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementChildPreload.js", global);
 
   Services.io.getProtocolHandler("app");
   Services.io.getProtocolHandler("default");