Bug 1795322 - Update toolkit modules references in browser/ code. r=mossop,Gijs,preferences-reviewers,desktop-theme-reviewers,dao

Differential Revision: https://phabricator.services.mozilla.com/D160031
This commit is contained in:
Mark Banner 2022-10-26 08:06:35 +00:00
parent 21e5bcac2b
commit 7beacf6f18
23 changed files with 42 additions and 42 deletions

View File

@ -144,7 +144,7 @@ pref("app.update.notifyDuringDownload", false);
// default value to migrate to the new location that this data is now stored
// (which is in a file in the update directory). Because of this, this pref
// should no longer be used directly. Instead, getAppUpdateAutoEnabled and
// getAppUpdateAutoEnabled from UpdateUtils.jsm should be used.
// getAppUpdateAutoEnabled from UpdateUtils.sys.mjs should be used.
#ifndef XP_WIN
pref("app.update.auto", true);
#endif
@ -1649,7 +1649,7 @@ pref("browser.aboutwelcome.templateMR", true);
pref("browser.messaging-system.whatsNewPanel.enabled", true);
// Experiment Manager
// See Console.jsm LOG_LEVELS for all possible values
// See Console.sys.mjs LOG_LEVELS for all possible values
pref("messaging-system.log", "warn");
pref("messaging-system.rsexperimentloader.enabled", true);
pref("messaging-system.rsexperimentloader.collection_id", "nimbus-desktop-experiments");
@ -1941,7 +1941,7 @@ pref("browser.contentblocking.report.show_mobile_app", true);
pref("browser.send_to_device_locales", "de,en-GB,en-US,es-AR,es-CL,es-ES,es-MX,fr,id,pl,pt-BR,ru,zh-TW");
// Avoid advertising in certain regions. Comma separated string of two letter ISO 3166-1 country codes.
// We're currently blocking all of Ukraine (ua), but would prefer to block just Crimea (ua-43). Currently, the Mozilla Location Service APIs used by Region.jsm only exposes the country, not the subdivision.
// We're currently blocking all of Ukraine (ua), but would prefer to block just Crimea (ua-43). Currently, the Mozilla Location Service APIs used by Region.sys.mjs only exposes the country, not the subdivision.
pref("browser.vpn_promo.disallowed_regions", "ae,by,cn,cu,iq,ir,kp,om,ru,sd,sy,tm,tr,ua");
// Default to enabling VPN promo messages to be shown when specified and allowed

View File

@ -1453,7 +1453,7 @@ var gUnifiedExtensions = {
if (!aBrowser[attr]) {
// A hacky way of setting the popup anchor outside the usual url bar
// icon box, similar to how it was done for CFR.
// See: https://searchfox.org/mozilla-central/rev/847b64cc28b74b44c379f9bff4f415b97da1c6d7/toolkit/modules/PopupNotifications.jsm#42
// See: https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/toolkit/modules/PopupNotifications.sys.mjs#40
aBrowser[attr] = aWindow.document.getElementById(
anchorID
// Anchor on the toolbar icon to position the popup right below the

View File

@ -11,7 +11,7 @@ ChromeUtils.defineESModuleGetters(this, {
* we are sure that an attempt to display a notification will not fail.
*/
async function waitForWindowReadyForPopupNotifications(win) {
// These are the same checks that PopupNotifications.jsm makes before it
// These are the same checks that PopupNotifications.sys.mjs makes before it
// allows a notification to open.
await TestUtils.waitForCondition(
() => win.gBrowser.selectedBrowser.docShellIsActive,

View File

@ -10,9 +10,9 @@ function getFirefoxExecutableFile() {
return file;
}
// This is copied from WindowsRegistry.jsm, but extended to support
// This is copied from WindowsRegistry.sys.mjs, but extended to support
// TYPE_BINARY, as that is how we represent doubles in the registry for
// the skeleton UI. However, we didn't extend WindowsRegistry.jsm itself,
// the skeleton UI. However, we didn't extend WindowsRegistry.sys.mjs itself,
// because TYPE_BINARY is kind of a footgun for javascript callers - our
// use case is just trivial (checking that the value is non-zero).
function readRegKeyExtended(aRoot, aPath, aKey, aRegistryNode = 0) {

View File

@ -3283,7 +3283,7 @@ BrowserGlue.prototype = {
false
); // Do not export.
if (autoExportHTML) {
// Sqlite.jsm and Places shutdown happen at profile-before-change, thus,
// Sqlite.sys.mjs and Places shutdown happen at profile-before-change, thus,
// to be on the safe side, this should run earlier.
lazy.AsyncShutdown.profileChangeTeardown.addBlocker(
"Places: export bookmarks.html",
@ -5165,7 +5165,7 @@ var ContentBlockingCategoriesPrefs = {
* While there are some built-in permission prompts, createPermissionPrompt
* can also be overridden by system add-ons or tests to provide new ones.
*
* This override ability is provided by Integration.jsm. See
* This override ability is provided by Integration.sys.mjs. See
* PermissionUI.jsm for an example of how to provide a new prompt
* from an add-on.
*/

View File

@ -103,7 +103,7 @@ add_setup(async function setup_head() {
}
if (msg.errorMessage.includes('Unknown event: ["jsonfile", "load"')) {
// Ignore telemetry errors from JSONFile.jsm.
// Ignore telemetry errors from JSONFile.sys.mjs.
return;
}

View File

@ -32,8 +32,8 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
);
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use lazy.log.debug() to create
// detailed messages during development. See LOG_LEVELS in Console.jsm for
// details.
// detailed messages during development. See LOG_LEVELS in Console.sys.mjs
// for details.
maxLogLevel: "error",
maxLogLevelPref: "browser.attribution.loglevel",
prefix: "AttributionCode",

View File

@ -15,8 +15,8 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
);
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use lazy.log.debug() to create
// detailed messages during development. See LOG_LEVELS in Console.jsm for
// details.
// detailed messages during development. See LOG_LEVELS in Console.sys.mjs
// for details.
maxLogLevel: "error",
maxLogLevelPref: "browser.attribution.mac.loglevel",
prefix: "MacAttribution",

View File

@ -167,7 +167,7 @@ const DoHConfigController = {
// consumer use.
currentConfig: makeBaseConfigObject(),
// Loads the client's region via Region.jsm. This might mean waiting
// Loads the client's region via Region.sys.mjs. This might mean waiting
// until the region is available.
async loadRegion() {
await new Promise(resolve => {

View File

@ -534,8 +534,8 @@ class TestFirefoxRefresh(MarionetteTestCase):
window.global = {};
global.LoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1", "nsILoginInfo", "init");
global.profSvc = Cc["@mozilla.org/toolkit/profile-service;1"].getService(Ci.nsIToolkitProfileService);
global.Preferences = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
global.Preferences = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
).Preferences;
global.FormHistory = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"

View File

@ -527,7 +527,7 @@ declare const totalBlockedCount: number;
### `recentBookmarks`
An array of GUIDs of recent bookmarks as provided by [`NewTabUtils.getRecentBookmarks`](https://searchfox.org/mozilla-central/rev/e0b0c38ee83f99d3cf868bad525ace4a395039f1/toolkit/modules/NewTabUtils.jsm#1087)
An array of GUIDs of recent bookmarks as provided by [`NewTabUtils.getRecentBookmarks`](https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/toolkit/modules/NewTabUtils.sys.mjs#1059)
#### Definition
@ -589,7 +589,7 @@ declare const attachedFxAOAuthClients: Promise<OAuthClient[]>
### `platformName`
[Platform information](https://searchfox.org/mozilla-central/rev/05a22d864814cb1e4352faa4004e1f975c7d2eb9/toolkit/modules/AppConstants.jsm#156).
[Platform information](https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/toolkit/modules/AppConstants.sys.mjs#153).
#### Definition

View File

@ -806,7 +806,7 @@ class PageAction {
const { content } = message;
// A hacky way of setting the popup anchor outside the usual url bar icon box
// See https://searchfox.org/mozilla-central/rev/847b64cc28b74b44c379f9bff4f415b97da1c6d7/toolkit/modules/PopupNotifications.jsm#42
// See https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/toolkit/modules/PopupNotifications.sys.mjs#40
browser.cfrpopupnotificationanchor =
this.window.document.getElementById(content.anchor_id) || this.container;
@ -819,7 +819,7 @@ class PageAction {
const { content } = message;
// A hacky way of setting the popup anchor outside the usual url bar icon box
// See https://searchfox.org/mozilla-central/rev/847b64cc28b74b44c379f9bff4f415b97da1c6d7/toolkit/modules/PopupNotifications.jsm#42
// See https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/toolkit/modules/PopupNotifications.sys.mjs#40
browser.cfrpopupnotificationanchor =
this.window.document.getElementById(content.anchor_id) || this.container;

View File

@ -116,7 +116,7 @@ export class FakensIPrefBranch {
FakensIPrefBranch.prototype.prefs = {};
/**
* Very simple fake for the most basic semantics of Preferences.jsm.
* Very simple fake for the most basic semantics of Preferences.sys.mjs.
* Extends FakensIPrefBranch.
*/
export class FakePrefs extends FakensIPrefBranch {
@ -136,7 +136,7 @@ export class FakePrefs extends FakensIPrefBranch {
}
/**
* Slimmed down version of toolkit/modules/EventEmitter.jsm
* Slimmed down version of toolkit/modules/EventEmitter.sys.mjs
*/
export function EventEmitter() {}
EventEmitter.decorate = function(objectToDecorate) {

View File

@ -1,9 +1,7 @@
/* eslint-env webextensions */
ChromeUtils.defineModuleGetter(
this,
"Preferences",
"resource://gre/modules/Preferences.jsm"
const { Preferences } = ChromeUtils.importESModule(
"resource://gre/modules/Preferences.sys.mjs"
);
const TP_PREF = "privacy.trackingprotection.enabled";

View File

@ -37,7 +37,7 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
);
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use log.debug() to create detailed
// messages during development. See LOG_LEVELS in Console.jsm for details.
// messages during development. See LOG_LEVELS in Console.sys.mjs for details.
maxLogLevel: "debug",
maxLogLevelPref: "browser.shell.loglevel",
prefix: "ShellService",

View File

@ -36,7 +36,8 @@ XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
).getFxAccountsSingleton();
});
// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
// See LOG_LEVELS in Console.sys.mjs. Common examples: "All", "Info", "Warn", &
// "Error".
const PREF_LOG_LEVEL = "browser.uitour.loglevel";
const BACKGROUND_PAGE_ACTIONS_ALLOWED = new Set([

View File

@ -1425,7 +1425,7 @@ class ProviderPlaces extends UrlbarProvider {
* Gets a Sqlite database handle.
*
* @returns {Promise<OpenedConnection>}
* A connection to the Sqlite database handle (according to {@link Sqlite.jsm}).
* A connection to the Sqlite database handle (according to {@link Sqlite.sys.mjs}).
* @throws A javascript exception
*/
getDatabaseHandle() {

View File

@ -302,8 +302,8 @@ class ProviderSearchTips extends UrlbarProvider {
}
// Second, wait 500ms. ts_paint waits at most 500ms after MozAfterPaint
// before ending. We use XPCOM directly instead of Timer.jsm to avoid the
// perf impact of loading Timer.jsm, in case it's not already loaded.
// before ending. We use XPCOM directly instead of Timer.sys.mjs to avoid the
// perf impact of loading Timer.sys.mjs, in case it's not already loaded.
await new Promise(resolve => {
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(resolve, 500, Ci.nsITimer.TYPE_ONE_SHOT);

View File

@ -3808,8 +3808,8 @@ async function doTimedCallbacks(callbacksBySecond) {
// timeout internal to macOS is being hit. This problem does not seem to happen
// when running the full browser, only during xpcshell tests. In fact the
// problem can be reproduced in an xpcshell test that simply creates an interval
// timer whose period is 1s (e.g., using `setInterval()` from Timer.jsm). After
// ~33 ticks, the timer's period jumps to ~10s.
// timer whose period is 1s (e.g., using `setInterval()` from Timer.sys.mjs).
// After ~33 ticks, the timer's period jumps to ~10s.
async function doTimedCallbacks(callbacksBySecond) {
await Promise.all(
Object.entries(callbacksBySecond).map(

View File

@ -20,8 +20,8 @@ var EXPORTED_SYMBOLS = ["PermissionUI"];
* permission request is coming up from content by way of the
* nsContentPermissionHelper. The system add-on could then do the following:
*
* const { Integration } = ChromeUtils.import(
* "resource://gre/modules/Integration.jsm"
* const { Integration } = ChromeUtils.importESModule(
* "resource://gre/modules/Integration.sys.mjs"
* );
* const { PermissionUI } = ChromeUtils.import(
* "resource:///modules/PermissionUI.jsm"
@ -188,7 +188,7 @@ var PermissionPromptPrototype = {
/**
* These are the options that will be passed to the PopupNotification when it
* is shown. See the documentation of `PopupNotifications_show` in
* PopupNotifications.jsm for details.
* PopupNotifications.sys.mjs for details.
*
* Note that prompt() will automatically set displayURI to
* be the URI of the requesting pricipal, unless the displayURI is exactly
@ -229,7 +229,7 @@ var PermissionPromptPrototype = {
* then you need to make sure its ID has the "-notification" suffix,
* and then return the prefix here.
*
* See PopupNotifications.jsm for more details.
* See PopupNotifications.sys.mjs for more details.
*
* @return {string}
* The unique ID that will be used to as the
@ -251,7 +251,7 @@ var PermissionPromptPrototype = {
/**
* The message to show to the user in the PopupNotification, see
* `PopupNotifications_show` in PopupNotifications.jsm.
* `PopupNotifications_show` in PopupNotifications.sys.mjs.
*
* Subclasses must override this.
*

View File

@ -287,7 +287,7 @@ checkbox {
#FontsDialog menulist:empty {
/* When there's no menupopup, while the font builder is running,
* the height of the menulist would otherwise shrink. This throws
* off the height determination SubDialog.jsm does, which then
* off the height determination SubDialog.sys.mjs does, which then
* leads to content being cut off. Fix by enforcing a minimum height
* when there's no content: */
min-height: max(32px, calc(1.4em + 16px));

View File

@ -14,7 +14,8 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
);
// Create a new instance of the ConsoleAPI so we can control the maxLogLevel with a pref.
// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
// See LOG_LEVELS in Console.sys.mjs. Common examples: "All", "Info", "Warn", &
// "Error".
const PREF_LOG_LEVEL = "extensions.mozscreenshots@mozilla.org.loglevel";
const lazy = {};
XPCOMUtils.defineLazyGetter(lazy, "log", () => {

View File

@ -263,7 +263,7 @@ var TestRunner = {
* Calculate the bounding box based on CSS selector from config for cropping
*
* @param {String[]} selectors - array of CSS selectors for relevant DOM element
* @return {Geometry.jsm Rect} Rect holding relevant x, y, width, height with padding
* @return {Geometry.sys.mjs Rect} Rect holding relevant x, y, width, height with padding
**/
_findBoundingBox(selectors, windowType) {
if (!selectors.length) {