Bug 1196975 - part5: waiveInterposition for childloader. r=mossop
authorGabor Krizsanits <gkrizsanits@mozilla.com>
Thu, 05 Nov 2015 12:06:00 +0100
changeset 293025 955cf6de17ba4ab8ef23f17d1eb91dcd91f5e35d
parent 293024 8674d248140d4aeae853ad03fc5e47c1d3c395c0
child 293026 528efd62f1c453b1739cadcc187be91d4fac07d0
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1196975
milestone45.0a1
Bug 1196975 - part5: waiveInterposition for childloader. r=mossop
addon-sdk/source/lib/framescript/content.jsm
addon-sdk/source/lib/toolkit/loader.js
--- a/addon-sdk/source/lib/framescript/content.jsm
+++ b/addon-sdk/source/lib/framescript/content.jsm
@@ -29,16 +29,18 @@ cpmm.sendAsyncMessage('sdk/remote/proces
 cpmm.addMessageListener('sdk/remote/process/load', ({ data: { modulePath, loaderID, options, reason } }) => {
   if (modulePath != PATH)
     return;
 
   // During startup races can mean we get a second load message
   if (addons.has(loaderID))
     return;
 
+  options.waiveInterposition = true;
+
   let loader = Loader.Loader(options);
   let addon = {
     loader,
     require: Loader.Require(loader, { id: 'LoaderHelper' }),
   }
   addons.set(loaderID, addon);
 
   cpmm.sendAsyncMessage('sdk/remote/process/attach', {
--- a/addon-sdk/source/lib/toolkit/loader.js
+++ b/addon-sdk/source/lib/toolkit/loader.js
@@ -233,17 +233,18 @@ const Sandbox = iced(function Sandbox(op
     sandboxName: options.name,
     principal: 'principal' in options ? options.principal : systemPrincipal,
     wantXrays: 'wantXrays' in options ? options.wantXrays : true,
     wantGlobalProperties: 'wantGlobalProperties' in options ?
                           options.wantGlobalProperties : [],
     sandboxPrototype: 'prototype' in options ? options.prototype : {},
     invisibleToDebugger: 'invisibleToDebugger' in options ?
                          options.invisibleToDebugger : false,
-    metadata: 'metadata' in options ? options.metadata : {}
+    metadata: 'metadata' in options ? options.metadata : {},
+    waiveIntereposition: !!options.waiveIntereposition
   };
 
   if (options.metadata && options.metadata.addonID) {
     options.addonId = options.metadata.addonID;
   }
 
   let sandbox = Cu.Sandbox(options.principal, options);
 
@@ -786,17 +787,17 @@ Loader.unload = unload;
 // - `resolve` Optional module `id` resolution function. If given it will be
 //   used to resolve module URIs, by calling it with require term, requirer
 //   module object (that has `uri` property) and `baseURI` of the loader.
 //   If `resolve` does not returns `uri` string exception will be thrown by
 //   an associated `require` call.
 function Loader(options) {
   let {
     modules, globals, resolve, paths, rootURI, manifest, requireMap, isNative,
-    metadata, sharedGlobal, sharedGlobalBlacklist, checkCompatibility
+    metadata, sharedGlobal, sharedGlobalBlacklist, checkCompatibility, waiveIntereposition
   } = override({
     paths: {},
     modules: {},
     globals: {
       get console() {
         // Import Console.jsm from here to prevent loading it until someone uses it
         let { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm");
         let console = new ConsoleAPI({
@@ -806,17 +807,18 @@ function Loader(options) {
         return this.console;
       }
     },
     checkCompatibility: false,
     resolve: options.isNative ?
       // Make the returned resolve function have the same signature
       (id, requirer) => Loader.nodeResolve(id, requirer, { rootURI: rootURI }) :
       Loader.resolve,
-    sharedGlobalBlacklist: ["sdk/indexed-db"]
+    sharedGlobalBlacklist: ["sdk/indexed-db"],
+    waiveIntereposition: false
   }, options);
 
   // Create overrides defaults, none at the moment
   if (typeof manifest != "object" || !manifest) {
     manifest = {};
   }
   if (typeof manifest.jetpack != "object" || !manifest.jetpack) {
     manifest.jetpack = {