зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1728669 - Simplify GeckoView:WebExtension:Connect/Message handlers r=agi
Differential Revision: https://phabricator.services.mozilla.com/D124260
This commit is contained in:
Родитель
18d37eb7a8
Коммит
8bf1867b97
|
@ -724,15 +724,7 @@ public class WebExtensionController {
|
|||
return;
|
||||
}
|
||||
|
||||
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 -> {
|
||||
extensionFromBundle(bundle).accept(extension -> {
|
||||
if ("GeckoView:WebExtension:NewTab".equals(event)) {
|
||||
newTab(message, extension);
|
||||
return;
|
||||
|
@ -767,6 +759,9 @@ public class WebExtensionController {
|
|||
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) {
|
||||
|
@ -776,6 +771,7 @@ public class WebExtensionController {
|
|||
return;
|
||||
}
|
||||
|
||||
final GeckoBundle senderBundle = bundle.getBundle("sender");
|
||||
final WebExtension.MessageSender sender = fromBundle(extension, senderBundle, session);
|
||||
if (sender == null) {
|
||||
if (callback != null) {
|
||||
|
|
|
@ -221,8 +221,6 @@ 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;
|
||||
|
@ -265,6 +263,7 @@ class GeckoViewConnection {
|
|||
sender: this.sender,
|
||||
data,
|
||||
portId,
|
||||
extensionId: this.sender.id,
|
||||
nativeApp: this.nativeApp,
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче