Bug 1429082 - Drop SyncChromeSender from proxy module. r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Tue, 09 Jan 2018 15:42:55 +0000
changeset 452755 2224eacab99e2e26829abbec1480da5823a2b30f
parent 452754 e6295a6ab95af04e570a397d9ceef7a97561a4e8
child 452756 bc3097b1f20a77c0f4fdcfb86597b2a4dd9f4670
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1429082
milestone59.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 1429082 - Drop SyncChromeSender from proxy module. r=whimboo The SyncChromeSender class and its factory construction function proxy.toChrome is not used in Marionette and can be safely removed. MozReview-Commit-ID: jBJ0nIkn3i
testing/marionette/proxy.js
--- a/testing/marionette/proxy.js
+++ b/testing/marionette/proxy.js
@@ -316,59 +316,14 @@ proxy.AsyncMessageChannel = class {
   }
 };
 proxy.AsyncMessageChannel.ReplyType = {
   Ok: 0,
   Value: 1,
   Error: 2,
 };
 
-/**
- * Creates a transparent interface from the content- to the chrome context.
- *
- * Calls to this object will be proxied via the frame's sendSyncMessage
- * ({@link nsISyncMessageSender}) function.  Since the message is
- * synchronous, the return value is presented as a return value.
- *
- * Example on how to use from a frame content script:
- *
- * <pre><code>
- *     let chrome = proxy.toChrome(sendSyncMessage.bind(this));
- *     let cookie = chrome.getCookie("foo");
- * </code></pre>
- *
- * @param {nsISyncMessageSender} sendSyncMessageFn
- *     The frame message manager's sendSyncMessage function.
- */
-proxy.toChrome = function(sendSyncMessageFn) {
-  let sender = new proxy.SyncChromeSender(sendSyncMessageFn);
-  return new Proxy(sender, ownPriorityGetterTrap);
-};
-
-/**
- * The SyncChromeSender sends synchronous RPC messages to the chrome
- * context, using a frame's sendSyncMessage ({@link nsISyncMessageSender})
- * function.
- *
- * Example on how to use from a frame content script:
- *
- * <pre><code>
- *     let sender = new SyncChromeSender(sendSyncMessage.bind(this));
- *     let res = sender.send("addCookie", cookie);
- * </code></pre>
- */
-proxy.SyncChromeSender = class {
-  constructor(sendSyncMessage) {
-    this.sendSyncMessage_ = sendSyncMessage;
-  }
-
-  send(func, args) {
-    let name = "Marionette:" + func.toString();
-    return this.sendSyncMessage_(name, marshal(args));
-  }
-};
-
 function marshal(args) {
   if (args.length == 1 && typeof args[0] == "object") {
     return args[0];
   }
   return args;
 }