Bug 1389718 - Fix receiving a message in proxy sandbox when running OOP. r=kmag, a=gchang
authorShane Caraveo <scaraveo@mozilla.com>
Thu, 24 Aug 2017 12:49:56 -0700
changeset 421441 36a40a9290b8976e7c3e9c2b60686161b7911b7f
parent 421440 5ade015bbd6d2327d6679220bb81b7b2ecb160d3
child 421442 1f1e924b5acd9996fdd28b27eb1ab5d28978d0e1
push id7684
push userryanvm@gmail.com
push dateMon, 28 Aug 2017 13:55:21 +0000
treeherdermozilla-beta@ec2c40638986 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, gchang
bugs1389718
milestone56.0
Bug 1389718 - Fix receiving a message in proxy sandbox when running OOP. r=kmag, a=gchang MozReview-Commit-ID: xgHIph36SG
toolkit/components/extensions/ExtensionParent.jsm
toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -215,24 +215,24 @@ ProxyMessenger = {
     }
 
     let promise1 = MessageChannel.sendMessage(receiverMM, messageName, data, {
       sender,
       recipient,
       responseType,
     });
 
-    if (!extension.isEmbedded || !extension.remote) {
+    if (!(extension.isEmbedded || recipient.toProxyScript) || !extension.remote) {
       return promise1;
     }
 
-    // If we have a remote, embedded extension, the legacy side is
-    // running in a different process than the WebExtension side.
-    // As a result, we need to dispatch the message to both the parent
-    // and extension processes, and manually merge the results.
+    // If we have a proxy script sandbox or a remote, embedded extension, where
+    // the legacy side is running in a different process than the WebExtension
+    // side. As a result, we need to dispatch the message to both the parent and
+    // extension processes, and manually merge the results.
     let promise2 = MessageChannel.sendMessage(Services.ppmm.getChildAt(0), messageName, data, {
       sender,
       recipient,
       responseType,
     });
 
     let result = undefined;
     let failures = 0;
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
@@ -62,8 +62,9 @@ skip-if = os == "android"
 [test_ext_storage_sync_crypto.js]
 skip-if = os == "android"
 [test_ext_storage_telemetry.js]
 skip-if = os == "android" # checking for telemetry needs to be updated: 1384923
 [test_ext_topSites.js]
 skip-if = os == "android"
 [test_native_messaging.js]
 skip-if = os == "android"
+[test_proxy_scripts.js]
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -47,12 +47,10 @@ tags = webextensions in-process-webexten
 [test_ext_unknown_permissions.js]
 [test_locale_converter.js]
 [test_locale_data.js]
 
 [test_ext_permissions.js]
 skip-if = os == "android" # Bug 1350559
 [test_ext_runtime_sendMessage_args.js]
 
-[test_proxy_scripts.js]
-
 [include:xpcshell-common.ini]
 [include:xpcshell-content.ini]