Bug 1824494 - Convert browser/actors/WebRTC* JSMs to ESMs. r=kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D175182
This commit is contained in:
Lata 2023-04-14 16:24:51 +00:00
Родитель 40532a5a80
Коммит 24d1599358
6 изменённых файлов: 15 добавлений и 30 удалений

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

@ -4,11 +4,9 @@
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"WebRTCChild",
"resource:///actors/WebRTCChild.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
WebRTCChild: "resource:///actors/WebRTCChild.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,

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

@ -2,16 +2,9 @@
* 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";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
var EXPORTED_SYMBOLS = ["WebRTCChild"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const lazy = {};
XPCOMUtils.defineLazyServiceGetter(
lazy,
@ -74,7 +67,7 @@ const GlobalMuteListener = {
},
};
class WebRTCChild extends JSWindowActorChild {
export class WebRTCChild extends JSWindowActorChild {
actorCreated() {
// The user might request that DOM notifications be silenced
// when sharing the screen. There doesn't seem to be a great

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

@ -2,13 +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";
var EXPORTED_SYMBOLS = ["WebRTCParent"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@ -33,7 +27,7 @@ XPCOMUtils.defineLazyServiceGetter(
"nsIOSPermissionRequest"
);
class WebRTCParent extends JSWindowActorParent {
export class WebRTCParent extends JSWindowActorParent {
didDestroy() {
// Media stream tracks end on unload, so call stopRecording() on them early
// *before* we go away, to ensure we're working with the right principal.

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

@ -28,7 +28,7 @@ with Files("PluginChild.sys.mjs"):
with Files("ScreenshotsComponentChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Screenshots")
with Files("WebRTCChild.jsm"):
with Files("WebRTCChild.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Site Permissions")
FINAL_TARGET_FILES.actors += [
@ -83,8 +83,8 @@ FINAL_TARGET_FILES.actors += [
"SearchSERPTelemetryChild.sys.mjs",
"SearchSERPTelemetryParent.sys.mjs",
"SwitchDocumentDirectionChild.sys.mjs",
"WebRTCChild.jsm",
"WebRTCParent.jsm",
"WebRTCChild.sys.mjs",
"WebRTCParent.sys.mjs",
]
BROWSER_CHROME_MANIFESTS += [

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

@ -60,8 +60,8 @@ async function simulateAudioOutputRequest(options) {
isSecure: true,
isHandlingUserInput: true,
};
const { WebRTCChild } = SpecialPowers.ChromeUtils.import(
"resource:///actors/WebRTCChild.jsm"
const { WebRTCChild } = SpecialPowers.ChromeUtils.importESModule(
"resource:///actors/WebRTCChild.sys.mjs"
);
WebRTCChild.observe(req, "getUserMedia:request");
}

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

@ -809,10 +809,10 @@ let JSWINDOWACTORS = {
WebRTC: {
parent: {
moduleURI: "resource:///actors/WebRTCParent.jsm",
esModuleURI: "resource:///actors/WebRTCParent.sys.mjs",
},
child: {
moduleURI: "resource:///actors/WebRTCChild.jsm",
esModuleURI: "resource:///actors/WebRTCChild.sys.mjs",
},
allFrames: true,