Bug 930091 - Clone marionette args into the sandbox rather than using a COW. r=mdas
authorBobby Holley <bobbyholley@gmail.com>
Sun, 20 Jul 2014 15:36:31 -0600
changeset 217132 030adb40ad1921a88b6ea4e46d97206084dc6147
parent 217131 f5f3d2f7bc4e146228fc822bac3293cffe8588da
child 217133 2eddd81bb167dae26bacb94777eded1b73ab1a88
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmdas
bugs930091
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 930091 - Clone marionette args into the sandbox rather than using a COW. r=mdas The current setup causes the arguments object (which is modified from the sandbox) to be a COW, which causes problems with our new restrictions on COWs. According to jgriffin, these are should be JSON-serializable, so the clone should be fine.
testing/marionette/marionette-listener.js
--- a/testing/marionette/marionette-listener.js
+++ b/testing/marionette/marionette-listener.js
@@ -509,18 +509,18 @@ function executeScript(msg, directInject
         sendError("Marionette.finish() not called", 17, null, asyncTestCommandId);
       }
       else {
         sendResponse({value: elementManager.wrapValue(res)}, asyncTestCommandId);
       }
     }
     else {
       try {
-        sandbox.__marionetteParams = elementManager.convertWrappedArguments(
-          msg.json.args, curFrame);
+        sandbox.__marionetteParams = Cu.cloneInto(elementManager.convertWrappedArguments(
+          msg.json.args, curFrame), sandbox, { wrapReflectors: true });
       }
       catch(e) {
         sendError(e.message, e.code, e.stack, asyncTestCommandId);
         return;
       }
 
       script = "let __marionetteFunc = function(){" + script + "};" +
                    "__marionetteFunc.apply(null, __marionetteParams);";
@@ -641,18 +641,18 @@ function executeWithCallback(msg, useFin
   if (useFinish) {
     if (msg.json.timeout == null || msg.json.timeout == 0) {
       sendError("Please set a timeout", 21, null, asyncTestCommandId);
     }
     scriptSrc = script;
   }
   else {
     try {
-      sandbox.__marionetteParams = elementManager.convertWrappedArguments(
-        msg.json.args, curFrame);
+      sandbox.__marionetteParams = Cu.cloneInto(elementManager.convertWrappedArguments(
+        msg.json.args, curFrame), sandbox, { wrapReflectors: true });
     }
     catch(e) {
       sendError(e.message, e.code, e.stack, asyncTestCommandId);
       return;
     }
 
     scriptSrc = "__marionetteParams.push(marionetteScriptFinished);" +
                 "let __marionetteFunc = function() { " + script + "};" +