Bug 1829649 - Convert JSM that actors are referenced to ESM. r=geckoview-reviewers,owlish

Differential Revision: https://phabricator.services.mozilla.com/D176314
This commit is contained in:
Makoto Kato 2023-05-03 14:56:41 +00:00
Родитель 393b07fc97
Коммит 28c21ac0ff
6 изменённых файлов: 9 добавлений и 28 удалений

Просмотреть файл

@ -5,17 +5,14 @@
var EXPORTED_SYMBOLS = ["GeckoViewAutoFillParent"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { GeckoViewActorParent } = ChromeUtils.importESModule(
"resource://gre/modules/GeckoViewActorParent.sys.mjs"
);
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
gAutofillManager: "resource://gre/modules/GeckoViewAutofill.jsm",
ChromeUtils.defineESModuleGetters(lazy, {
gAutofillManager: "resource://gre/modules/GeckoViewAutofill.sys.mjs",
});
class GeckoViewAutoFillParent extends GeckoViewActorParent {

Просмотреть файл

@ -8,20 +8,13 @@ const { GeckoViewActorChild } = ChromeUtils.importESModule(
"resource://gre/modules/GeckoViewActorChild.sys.mjs"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MediaUtils: "resource://gre/modules/MediaUtils.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
MediaUtils: "resource://gre/modules/MediaUtils.jsm",
});
var EXPORTED_SYMBOLS = ["MediaControlDelegateChild"];
class MediaControlDelegateChild extends GeckoViewActorChild {

Просмотреть файл

@ -310,7 +310,7 @@ public class MediaSession {
}
/* package */ static @NonNull ElementMetadata fromBundle(final GeckoBundle bundle) {
// Sync with MediaUtils.jsm.
// Sync with MediaUtils.sys.mjs.
return new ElementMetadata(
bundle.getString("src"),
bundle.getDouble("duration", 0.0),

Просмотреть файл

@ -1,13 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { GeckoViewUtils } = ChromeUtils.importESModule(
"resource://gre/modules/GeckoViewUtils.sys.mjs"
);
var EXPORTED_SYMBOLS = ["gAutofillManager"];
import { GeckoViewUtils } from "resource://gre/modules/GeckoViewUtils.sys.mjs";
class Autofill {
constructor(sessionId, eventDispatcher) {
@ -96,6 +91,6 @@ class AutofillManager {
}
}
var gAutofillManager = new AutofillManager();
export var gAutofillManager = new AutofillManager();
const { debug, warn } = GeckoViewUtils.initLogging("Autofill");

Просмотреть файл

@ -2,11 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const EXPORTED_SYMBOLS = ["MediaUtils"];
const MediaUtils = {
export const MediaUtils = {
getMetadata(aElement) {
if (!aElement) {
return null;

Просмотреть файл

@ -13,7 +13,7 @@ EXTRA_JS_MODULES += [
"GeckoViewActorManager.sys.mjs",
"GeckoViewActorParent.sys.mjs",
"GeckoViewAutocomplete.jsm",
"GeckoViewAutofill.jsm",
"GeckoViewAutofill.sys.mjs",
"GeckoViewChildModule.jsm",
"GeckoViewConsole.sys.mjs",
"GeckoViewContent.sys.mjs",
@ -35,6 +35,6 @@ EXTRA_JS_MODULES += [
"GeckoViewUtils.sys.mjs",
"GeckoViewWebExtension.sys.mjs",
"LoadURIDelegate.sys.mjs",
"MediaUtils.jsm",
"MediaUtils.sys.mjs",
"Messaging.sys.mjs",
]