Skip to content

Commit 70046e9

Browse files
committed
Bug 1804661 - Convert browser/components/StartupRecorder.jsm to an ES module. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D164206
1 parent 55b80ef commit 70046e9

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

browser/base/content/test/performance/browser.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[DEFAULT]
2-
# to avoid overhead when running the browser normally, StartupRecorder.jsm will
2+
# to avoid overhead when running the browser normally, StartupRecorder.sys.mjs will
33
# do almost nothing unless browser.startup.record is true.
44
# gfx.canvas.willReadFrequently.enable is just an optimization, but needs to be
55
# set during early startup to have an impact as a canvas will be used by
6-
# StartupRecorder.jsm
6+
# StartupRecorder.sys.mjs
77
prefs =
88
# Skip migration work in BG__migrateUI for browser_startup.js since it isn't
99
# representative of common startup.
@@ -51,7 +51,7 @@ support-files =
5151
[browser_startup_flicker.js]
5252
run-if =
5353
debug
54-
nightly_build # Requires StartupRecorder.jsm, which isn't shipped everywhere by default
54+
nightly_build # Requires StartupRecorder.sys.mjs, which isn't shipped everywhere by default
5555
[browser_startup_hiddenwindow.js]
5656
skip-if =
5757
os == "mac"

browser/base/content/test/performance/browser_startup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const startupPhases = {
2929
allowlist: {
3030
modules: new Set([
3131
"resource:///modules/BrowserGlue.sys.mjs",
32-
"resource:///modules/StartupRecorder.jsm",
32+
"resource:///modules/StartupRecorder.sys.mjs",
3333
"resource://gre/modules/AppConstants.sys.mjs",
3434
"resource://gre/modules/ActorManagerParent.sys.mjs",
3535
"resource://gre/modules/CustomElementsListener.jsm",

browser/base/content/test/performance/io/browser.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ skip-if =
66
debug
77
tsan
88
asan
9-
# to avoid overhead when running the browser normally, StartupRecorder.jsm will
9+
# to avoid overhead when running the browser normally, StartupRecorder.sys.mjs will
1010
# do almost nothing unless browser.startup.record is true.
1111
# gfx.canvas.willReadFrequently.enable is just an optimization, but needs to be
1212
# set during early startup to have an impact as a canvas will be used by
13-
# StartupRecorder.jsm
13+
# StartupRecorder.sys.mjs
1414
prefs =
1515
browser.startup.record=true
1616
gfx.canvas.willReadFrequently.enable=true

browser/components/StartupRecorder.jsm renamed to browser/components/StartupRecorder.sys.mjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
var EXPORTED_SYMBOLS = ["StartupRecorder"];
6-
75
const Cm = Components.manager;
86
Cm.QueryInterface(Ci.nsIServiceManager);
97

10-
const { AppConstants } = ChromeUtils.importESModule(
11-
"resource://gre/modules/AppConstants.sys.mjs"
12-
);
8+
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
139

1410
let firstPaintNotification = "widget-first-paint";
1511
// widget-first-paint fires much later than expected on Linux.
@@ -59,7 +55,7 @@ let afterPaintListener = () => {
5955
* This component only exists in nightly and debug builds, it doesn't ship in
6056
* our release builds.
6157
*/
62-
function StartupRecorder() {
58+
export function StartupRecorder() {
6359
this.wrappedJSObject = this;
6460
this.data = {
6561
images: {
@@ -74,6 +70,7 @@ function StartupRecorder() {
7470
this._resolve = resolve;
7571
});
7672
}
73+
7774
StartupRecorder.prototype = {
7875
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
7976

browser/components/components.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if (buildconfig.substs.get('MOZ_DEBUG') or
7171
{
7272
'cid': '{11c095b2-e42e-4bdf-9dd0-aed87595f6a4}',
7373
'contract_ids': ['@mozilla.org/test/startuprecorder;1'],
74-
'jsm': 'resource:///modules/StartupRecorder.jsm',
74+
'esModule': 'resource:///modules/StartupRecorder.sys.mjs',
7575
'constructor': 'StartupRecorder',
7676
},
7777
]

browser/components/moz.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ EXTRA_JS_MODULES += [
9494

9595
if CONFIG["MOZ_DEBUG"] or CONFIG["MOZ_DEV_EDITION"] or CONFIG["NIGHTLY_BUILD"]:
9696
EXTRA_JS_MODULES += [
97-
"StartupRecorder.jsm",
97+
"StartupRecorder.sys.mjs",
9898
]
9999

100100
BROWSER_CHROME_MANIFESTS += [

0 commit comments

Comments
 (0)