Bug 1034262 - Don't use wantXrays for requiresAddonGlobal sandboxes. r=gabor
authorBobby Holley <bobbyholley@gmail.com>
Thu, 10 Jul 2014 10:04:30 -0700
changeset 193405 61c1236e6a36a4fd2d16b4ef9e290a6bef62c995
parent 193404 bf3916efc0bf6b337ceb73b8756ce04a006e0dab
child 193406 bb54fa82e9d2740bfaaa5dc9f1c093d43ee5df4a
push id27117
push userryanvm@gmail.com
push dateThu, 10 Jul 2014 22:23:14 +0000
treeherdermozilla-central@e1a037c085d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs1034262
milestone33.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 1034262 - Don't use wantXrays for requiresAddonGlobal sandboxes. r=gabor
addon-sdk/source/lib/sdk/content/sandbox.js
addon-sdk/source/lib/sdk/deprecated/traits-worker.js
--- a/addon-sdk/source/lib/sdk/content/sandbox.js
+++ b/addon-sdk/source/lib/sdk/content/sandbox.js
@@ -131,17 +131,17 @@ const WorkerSandbox = Class({
       if (!waiveSecurityMembrane)
         principals = EXPANDED_PRINCIPALS.concat(window);
     }
 
     // Create the sandbox and bind it to window in order for content scripts to
     // have access to all standard globals (window, document, ...)
     let content = sandbox(principals, {
       sandboxPrototype: proto,
-      wantXrays: true,
+      wantXrays: !requiresAddonGlobal(worker),
       wantGlobalProperties: wantGlobalProperties,
       wantExportHelpers: true,
       sameZoneAs: window,
       metadata: {
         SDKContentScript: true,
         'inner-window-id': getInnerId(window)
       }
     });
--- a/addon-sdk/source/lib/sdk/deprecated/traits-worker.js
+++ b/addon-sdk/source/lib/sdk/deprecated/traits-worker.js
@@ -144,17 +144,17 @@ const WorkerSandbox = EventEmitter.compo
       delete proto.XMLHttpRequest;
       wantGlobalProperties.push("XMLHttpRequest");
     }
 
     // Create the sandbox and bind it to window in order for content scripts to
     // have access to all standard globals (window, document, ...)
     let content = this._sandbox = sandbox(principals, {
       sandboxPrototype: proto,
-      wantXrays: true,
+      wantXrays: !worker._injectInDocument,
       wantGlobalProperties: wantGlobalProperties,
       sameZoneAs: window,
       metadata: {
         SDKContentScript: true,
         'inner-window-id': getInnerId(window)
       }
     });
     // We have to ensure that window.top and window.parent are the exact same