Backed out 1 changesets (bug 1728669) for mochitest failures on test_ext_tabs_executeScript_good.html
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Thu, 02 Sep 2021 02:25:00 +0300
changeset 590542 214cd072efe2e84a3573933ba51de6f9ede08d79
parent 590541 a137b0acf07d45759f3c1be55fee63ce1366f199
child 590543 358ce9525a988b8fd9d175fae125ee5b53747794
push id149028
push usernbeleuzu@mozilla.com
push dateWed, 01 Sep 2021 23:26:37 +0000
treeherderautoland@358ce9525a98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1728669
milestone93.0a1
backs out35295637d5fd1494568118ed0b61b7e0ecde5d65
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
Backed out 1 changesets (bug 1728669) for mochitest failures on test_ext_tabs_executeScript_good.html Backed out changeset 35295637d5fd (bug 1728669)
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java
mobile/android/modules/geckoview/GeckoViewWebExtension.jsm
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java
@@ -719,17 +719,25 @@ public class WebExtensionController {
             return;
         } else if ("GeckoView:WebExtension:DebuggerListUpdated".equals(event)) {
             if (mDebuggerDelegate != null) {
                 mDebuggerDelegate.onExtensionListUpdated();
             }
             return;
         }
 
-        extensionFromBundle(bundle).accept(extension -> {
+        final GeckoBundle senderBundle;
+        if ("GeckoView:WebExtension:Connect".equals(event) ||
+                "GeckoView:WebExtension:Message".equals(event)) {
+            senderBundle = bundle.getBundle("sender");
+        } else {
+            senderBundle = bundle;
+        }
+
+        extensionFromBundle(senderBundle).accept(extension -> {
             if ("GeckoView:WebExtension:NewTab".equals(event)) {
                 newTab(message, extension);
                 return;
             } else if ("GeckoView:WebExtension:UpdateTab".equals(event)) {
                 updateTab(message, extension);
                 return;
             } else if ("GeckoView:WebExtension:CloseTab".equals(event)) {
                 closeTab(message, extension);
@@ -754,29 +762,25 @@ public class WebExtensionController {
                 return;
             } else if ("GeckoView:BrowsingData:Clear".equals(event)) {
                 browsingDataClear(message, extension);
                 return;
             } else if ("GeckoView:WebExtension:Download".equals(event)) {
                 download(message, extension);
                 return;
             }
-
-            // GeckoView:WebExtension:Connect and GeckoView:WebExtension:Message
-            // are handled below.
             final String nativeApp = bundle.getString("nativeApp");
             if (nativeApp == null) {
                 if (BuildConfig.DEBUG) {
                     throw new RuntimeException("Missing required nativeApp message parameter.");
                 }
                 callback.sendError("Missing nativeApp parameter.");
                 return;
             }
 
-            final GeckoBundle senderBundle = bundle.getBundle("sender");
             final WebExtension.MessageSender sender = fromBundle(extension, senderBundle, session);
             if (sender == null) {
                 if (callback != null) {
                     if (BuildConfig.DEBUG) {
                         try {
                             Log.e(LOGTAG, "Could not find recipient for message: " + bundle.toJSONObject());
                         } catch (final JSONException ex) {
                         }
--- a/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm
@@ -216,16 +216,18 @@ class EmbedderPort {
       }
     }
   }
 }
 
 class GeckoViewConnection {
   constructor(sender, target, nativeApp, allowContentMessaging) {
     this.sender = sender;
+    // Map from the extension MessageSender to the android GeckoBundle format.
+    sender.extensionId = sender.id;
     this.target = target;
     this.nativeApp = nativeApp;
     this.allowContentMessaging = allowContentMessaging;
 
     if (!allowContentMessaging && sender.envType !== "addon_child") {
       throw new Error(`Unexpected messaging sender: ${JSON.stringify(sender)}`);
     }
   }
@@ -258,17 +260,16 @@ class GeckoViewConnection {
   }
 
   _sendMessage({ type, portId, data }) {
     const message = {
       type,
       sender: this.sender,
       data,
       portId,
-      extensionId: this.sender.id,
       nativeApp: this.nativeApp,
     };
 
     return this.dispatcher.sendRequestForResult(message);
   }
 
   sendMessage(data) {
     return this._sendMessage({