Bug 1788927 - Convert browser/actors/AboutTabCrashed* JSM modules to ESMs. r=mconley
authorachris16 <axtinemvsn@gmail.com>
Sat, 10 Sep 2022 21:58:40 +0000
changeset 635158 d4b323679ebb8f0a27165bed34604f57651013ad
parent 635157 367ffdfc489ce684e5230d3d4eb8057b2c7b55b5
child 635159 930ba77bcee76c518fad3da65680500019a23529
push id40226
push usersmolnar@mozilla.com
push dateSun, 11 Sep 2022 09:17:36 +0000
treeherdermozilla-central@2564037ee9c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1788927
milestone106.0a1
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
Bug 1788927 - Convert browser/actors/AboutTabCrashed* JSM modules to ESMs. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D157042
browser/actors/AboutTabCrashedChild.jsm
browser/actors/AboutTabCrashedChild.sys.mjs
browser/actors/AboutTabCrashedParent.jsm
browser/actors/AboutTabCrashedParent.sys.mjs
browser/actors/moz.build
browser/components/BrowserGlue.jsm
rename from browser/actors/AboutTabCrashedChild.jsm
rename to browser/actors/AboutTabCrashedChild.sys.mjs
--- a/browser/actors/AboutTabCrashedChild.jsm
+++ b/browser/actors/AboutTabCrashedChild.sys.mjs
@@ -1,12 +1,10 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/. */
 
-var EXPORTED_SYMBOLS = ["AboutTabCrashedChild"];
-
 const { RemotePageChild } = ChromeUtils.import(
   "resource://gre/actors/RemotePageChild.jsm"
 );
 
-class AboutTabCrashedChild extends RemotePageChild {}
+export class AboutTabCrashedChild extends RemotePageChild {}
rename from browser/actors/AboutTabCrashedParent.jsm
rename to browser/actors/AboutTabCrashedParent.sys.mjs
--- a/browser/actors/AboutTabCrashedParent.jsm
+++ b/browser/actors/AboutTabCrashedParent.sys.mjs
@@ -1,29 +1,26 @@
 /* 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";
 
-var EXPORTED_SYMBOLS = ["AboutTabCrashedParent"];
+import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
 
-const { XPCOMUtils } = ChromeUtils.importESModule(
-  "resource://gre/modules/XPCOMUtils.sys.mjs"
-);
 const lazy = {};
 XPCOMUtils.defineLazyModuleGetters(lazy, {
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
 });
 
 // A list of all of the open about:tabcrashed pages.
 let gAboutTabCrashedPages = new Map();
 
-class AboutTabCrashedParent extends JSWindowActorParent {
+export class AboutTabCrashedParent extends JSWindowActorParent {
   didDestroy() {
     this.removeCrashedPage();
   }
 
   async receiveMessage(message) {
     let browser = this.browsingContext.top.embedderElement;
     if (!browser) {
       // If there is no browser, remove the crashed page from the set
--- a/browser/actors/moz.build
+++ b/browser/actors/moz.build
@@ -39,18 +39,18 @@ FINAL_TARGET_FILES.actors += [
     "AboutPocketChild.jsm",
     "AboutPocketParent.jsm",
     "AboutPrivateBrowsingChild.jsm",
     "AboutPrivateBrowsingParent.jsm",
     "AboutProtectionsChild.jsm",
     "AboutProtectionsParent.jsm",
     "AboutReaderChild.jsm",
     "AboutReaderParent.jsm",
-    "AboutTabCrashedChild.jsm",
-    "AboutTabCrashedParent.jsm",
+    "AboutTabCrashedChild.sys.mjs",
+    "AboutTabCrashedParent.sys.mjs",
     "BlockedSiteChild.jsm",
     "BlockedSiteParent.jsm",
     "BrowserProcessChild.jsm",
     "BrowserTabChild.jsm",
     "BrowserTabParent.jsm",
     "ClickHandlerChild.jsm",
     "ClickHandlerParent.jsm",
     "ContentSearchChild.jsm",
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -347,21 +347,20 @@ let JSWINDOWACTORS = {
         pagehide: { mozSystemGroup: true, createActor: false },
       },
     },
     messageManagerGroups: ["browsers"],
   },
 
   AboutTabCrashed: {
     parent: {
-      moduleURI: "resource:///actors/AboutTabCrashedParent.jsm",
+      esModuleURI: "resource:///actors/AboutTabCrashedParent.sys.mjs",
     },
     child: {
-      moduleURI: "resource:///actors/AboutTabCrashedChild.jsm",
-
+      esModuleURI: "resource:///actors/AboutTabCrashedChild.sys.mjs",
       events: {
         DOMDocElementInserted: { capture: true },
       },
     },
 
     matches: ["about:tabcrashed*"],
   },