Bug 682048 - Change B2G frame script handling to support anon/global scope (r=fabrice)
☠☠ backed out by 5045e4af5807 ☠ ☠
authorBill McCloskey <wmccloskey@mozilla.com>
Sat, 23 Nov 2013 21:32:39 -0800
changeset 157228 1fd1596ffb9feb3d814eefe9afee2ac73467306f
parent 157227 1375faef4ea1cfba8ef8093d3467401cbcaf2e61
child 157229 58bfa3b59c2cd362063fdbd9b3917778ac8683df
push id36659
push userwmccloskey@mozilla.com
push dateSun, 24 Nov 2013 05:32:55 +0000
treeherdermozilla-inbound@58bfa3b59c2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs682048
milestone28.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 682048 - Change B2G frame script handling to support anon/global scope (r=fabrice)
b2g/components/ErrorPage.jsm
b2g/components/PaymentGlue.js
b2g/components/SignInToWebsite.jsm
dom/inputmethod/Keyboard.jsm
testing/marionette/marionette-frame-manager.js
testing/marionette/marionette-server.js
--- a/b2g/components/ErrorPage.jsm
+++ b/b2g/components/ErrorPage.jsm
@@ -156,17 +156,17 @@ let ErrorPage = {
 
   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 {
       if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) {
-        mm.loadFrameScript(kErrorPageFrameScript, true);
+        mm.loadFrameScript(kErrorPageFrameScript, true, true);
       }
     } catch (e) {
       dump('Error loading ' + kErrorPageFrameScript + ' as frame script: ' + e + '\n');
     }
     mm.addMessageListener('ErrorPage:AddCertException', this._addCertException.bind(this));
   }
 };
 
--- a/b2g/components/PaymentGlue.js
+++ b/b2g/components/PaymentGlue.js
@@ -126,17 +126,17 @@ PaymentUI.prototype = {
         _error("ERROR_LOADING_PAYMENT_SHIM");
         return;
       }
       let frame = evt.detail.frame;
       let frameLoader = frame.QueryInterface(Ci.nsIFrameLoaderOwner)
                         .frameLoader;
       let mm = frameLoader.messageManager;
       try {
-        mm.loadFrameScript(kPaymentShimFile, true);
+        mm.loadFrameScript(kPaymentShimFile, true, true);
         mm.sendAsyncMessage("Payment:LoadShim", { requestId: aRequestId });
       } catch (e) {
         if (this._debug) {
           this.LOG("Error loading " + kPaymentShimFile + " as a frame script: "
                     + e);
         }
         _error("ERROR_LOADING_PAYMENT_SHIM");
       } finally {
--- a/b2g/components/SignInToWebsite.jsm
+++ b/b2g/components/SignInToWebsite.jsm
@@ -282,17 +282,17 @@ Pipe.prototype = {
             // The window has opened.  Inject the identity shim file containing
             // the callbacks in the content script.  This could be either the
             // visible popup that the user interacts with, or it could be an
             // invisible frame.
             let frame = evt.detail.frame;
             let frameLoader = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
             mm = frameLoader.messageManager;
             try {
-              mm.loadFrameScript(kIdentityShimFile, true);
+              mm.loadFrameScript(kIdentityShimFile, true, true);
               log("Loaded shim", kIdentityShimFile);
             } catch (e) {
               log("Error loading", kIdentityShimFile, "as a frame script:", e);
             }
 
             // There are two messages that the delegate can send back: a "do
             // method" event, and a "finished" event.  We pass the do-method
             // events straight to the caller for interpretation and handling.
--- a/dom/inputmethod/Keyboard.jsm
+++ b/dom/inputmethod/Keyboard.jsm
@@ -80,17 +80,17 @@ this.Keyboard = {
     mm.addMessageListener('Forms:GetContext:Result:OK', this);
     mm.addMessageListener('Forms:SetComposition:Result:OK', this);
     mm.addMessageListener('Forms:EndComposition:Result:OK', this);
 
     // When not running apps OOP, we need to load forms.js here since this
     // won't happen from dom/ipc/preload.js
     try {
       if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) {
-        mm.loadFrameScript(kFormsFrameScript, true);
+        mm.loadFrameScript(kFormsFrameScript, true, true);
       }
     } catch (e) {
       dump('Error loading ' + kFormsFrameScript + ' as frame script: ' + e + '\n');
     }
   },
 
   receiveMessage: function keyboardReceiveMessage(msg) {
     // If we get a 'Keyboard:XXX' message, check that the sender has the
--- a/testing/marionette/marionette-frame-manager.js
+++ b/testing/marionette/marionette-frame-manager.js
@@ -121,17 +121,17 @@ FrameManager.prototype = {
         return;
       }
     }
 
     // If we get here, then we need to load the frame script in this frame, 
     // and set the frame's ChromeMessageSender as the active message manager the server will listen to
     this.addMessageManagerListeners(mm);
     logger.info("frame-manager load script: " + mm.toString());
-    mm.loadFrameScript(FRAME_SCRIPT, true);
+    mm.loadFrameScript(FRAME_SCRIPT, true, true);
     let aFrame = new MarionetteRemoteFrame(message.json.win, message.json.frame);
     aFrame.messageManager = Cu.getWeakReference(mm);
     remoteFrames.push(aFrame);
     this.currentRemoteFrame = aFrame;
   },
 
   /*
    * This function handles switching back to the frame that was interrupted by the modal dialog.
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -2444,17 +2444,17 @@ BrowserObj.prototype = {
    * Loads content listeners if we don't already have them
    *
    * @param string script
    *        path of script to load
    * @param nsIDOMWindow frame
    *        frame to load the script in
    */
   loadFrameScript: function BO_loadFrameScript(script, frame) {
-    frame.window.messageManager.loadFrameScript(script, true);
+    frame.window.messageManager.loadFrameScript(script, true, true);
     Services.prefs.setBoolPref("marionette.contentListener", true);
   },
 
   /**
    * Registers a new frame, and sets its current frame id to this frame
    * if it is not already assigned, and if a) we already have a session 
    * or b) we're starting a new session and it is the right start frame.
    *