forked from mirrors/gecko-dev
Bug 1792341 - Migrate most of the rest of toolkit/modules/ to be system ES modules. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D158451
This commit is contained in:
parent
7efc67a52a
commit
69a9e3e717
22 changed files with 75 additions and 121 deletions
|
|
@ -221,7 +221,7 @@ toolkit/components/translation/cld2/
|
|||
|
||||
# Uses preprocessing
|
||||
toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
|
||||
toolkit/modules/AppConstants.jsm
|
||||
toolkit/modules/AppConstants.sys.mjs
|
||||
|
||||
# Tests of ESLint command.
|
||||
tools/lint/test/files
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ const startupPhases = {
|
|||
modules: new Set([
|
||||
"resource:///modules/BrowserGlue.jsm",
|
||||
"resource:///modules/StartupRecorder.jsm",
|
||||
"resource://gre/modules/AppConstants.jsm",
|
||||
"resource://gre/modules/ActorManagerParent.jsm",
|
||||
"resource://gre/modules/AppConstants.sys.mjs",
|
||||
"resource://gre/modules/ActorManagerParent.sys.mjs",
|
||||
"resource://gre/modules/CustomElementsListener.jsm",
|
||||
"resource://gre/modules/MainProcessSingleton.jsm",
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs",
|
||||
|
|
@ -63,7 +63,7 @@ const startupPhases = {
|
|||
"resource://gre/modules/NewTabUtils.sys.mjs",
|
||||
"resource://gre/modules/PageThumbs.jsm",
|
||||
"resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
"resource://gre/modules/Preferences.jsm",
|
||||
"resource://gre/modules/Preferences.sys.mjs",
|
||||
"resource://gre/modules/SearchService.sys.mjs",
|
||||
"resource://gre/modules/Sqlite.sys.mjs",
|
||||
]),
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ const known_scripts = {
|
|||
"chrome://mochikit/content/ShutdownLeaksCollector.jsm",
|
||||
|
||||
// General utilities
|
||||
"resource://gre/modules/AppConstants.jsm",
|
||||
"resource://gre/modules/DeferredTask.jsm",
|
||||
"resource://gre/modules/Timer.jsm",
|
||||
"resource://gre/modules/AppConstants.sys.mjs",
|
||||
"resource://gre/modules/DeferredTask.sys.mjs",
|
||||
"resource://gre/modules/Timer.sys.mjs",
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs",
|
||||
|
||||
// Logging related
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ const known_scripts = {
|
|||
actorModuleURI,
|
||||
|
||||
// General utilities
|
||||
"resource://gre/modules/AppConstants.jsm",
|
||||
"resource://gre/modules/DeferredTask.jsm",
|
||||
"resource://gre/modules/AppConstants.sys.mjs",
|
||||
"resource://gre/modules/DeferredTask.sys.mjs",
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs",
|
||||
|
||||
// Logging related
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ prefs.observe("foo", aCallback);
|
|||
prefs.ignore("foo", aCallback);
|
||||
```
|
||||
|
||||
See [toolkit/modules/Preferences.jsm](https://searchfox.mozilla.org/mozilla-central/source/toolkit/modules/Preferences.jsm)
|
||||
See :searchfox:`toolkit/modules/Preferences.sys.mjs <source/toolkit/modules/Preferences.sys.mjs>`
|
||||
for more information about what methods are available.
|
||||
|
||||
## Discovery Stream Preferences
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ declare namespace MockedExports {
|
|||
*/
|
||||
interface KnownModules {
|
||||
Services: typeof import("Services");
|
||||
"resource://gre/modules/AppConstants.jsm": typeof import("resource://gre/modules/AppConstants.jsm");
|
||||
"resource://gre/modules/AppConstants.sys.mjs": typeof import("resource://gre/modules/AppConstants.sys.mjs");
|
||||
"resource:///modules/CustomizableUI.jsm": typeof import("resource:///modules/CustomizableUI.jsm");
|
||||
"resource:///modules/CustomizableWidgets.jsm": typeof import("resource:///modules/CustomizableWidgets.jsm");
|
||||
"resource://devtools/shared/loader/Loader.sys.mjs": typeof import("resource://devtools/shared/loader/Loader.sys.mjs");
|
||||
|
|
@ -200,7 +200,7 @@ declare namespace MockedExports {
|
|||
decorate: (target: object) => void;
|
||||
};
|
||||
|
||||
const AppConstantsJSM: {
|
||||
const AppConstantsSYSMJS: {
|
||||
AppConstants: {
|
||||
platform: string;
|
||||
};
|
||||
|
|
@ -334,8 +334,8 @@ declare module "ChromeUtils" {
|
|||
export = ChromeUtils;
|
||||
}
|
||||
|
||||
declare module "resource://gre/modules/AppConstants.jsm" {
|
||||
export = MockedExports.AppConstantsJSM;
|
||||
declare module "resource://gre/modules/AppConstants.sys.mjs" {
|
||||
export = MockedExports.AppConstantsSYSMJS;
|
||||
}
|
||||
|
||||
declare module "resource://gre/modules/WebChannel.jsm" {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ Message Manager Actors
|
|||
|
||||
While the JSWindowActor mechanism was being designed and developed, large sections of our framescripts were converted to an "actor style" pattern to make eventual porting to JSWindowActors easier. These Actors use the Message Manager under the hood, but made it much easier to shrink our framescripts, and also allowed us to gain significant memory savings by having the actors be lazily instantiated.
|
||||
|
||||
You can find the list of Message Manager Actors (or "Legacy Actors") in `BrowserGlue.jsm <https://searchfox.org/mozilla-central/source/browser/components/BrowserGlue.jsm>`_ and `ActorManagerParent.jsm <https://searchfox.org/mozilla-central/source/toolkit/modules/ActorManagerParent.jsm>`_, in the ``LEGACY_ACTORS`` lists.
|
||||
You can find the list of Message Manager Actors (or "Legacy Actors") in :searchfox:`BrowserGlue.jsm <browser/components/BrowserGlue.jsm>` and :searchfox:`ActorManagerParent.sys.mjs <toolkit/modules/ActorManagerParent.sys.mjs>`, in the ``LEGACY_ACTORS`` lists.
|
||||
|
||||
.. note::
|
||||
The split in Message Manager Actors defined between ``BrowserGlue`` and ``ActorManagerParent`` is mainly to keep Firefox Desktop specific Actors separate from Actors that can (in theory) be instantiated for non-Desktop browsers (like Fennec and GeckoView-based browsers). Firefox Desktop-specific Actors should be registered in ``BrowserGlue``. Shared "toolkit" Actors should go into ``ActorManagerParent``.
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ def get_embedded_version(version, buildid):
|
|||
return version
|
||||
|
||||
|
||||
def get_appconstants_jsm_values(finder, *args):
|
||||
def get_appconstants_sys_mjs_values(finder, *args):
|
||||
r"""Extract values, such as the display version like `MOZ_APP_VERSION_DISPLAY:
|
||||
"...";`, from the omnijar. This allows to determine the beta number, like
|
||||
`X.YbW`, where the regular beta version is only `X.Y`. Takes a list of
|
||||
|
|
@ -194,7 +194,7 @@ def get_appconstants_jsm_values(finder, *args):
|
|||
"""
|
||||
|
||||
lines = defaultdict(list)
|
||||
for _, f in finder.find("**/modules/AppConstants.jsm"):
|
||||
for _, f in finder.find("**/modules/AppConstants.sys.mjs"):
|
||||
for line in f.open().read().decode("utf-8").splitlines():
|
||||
for arg in args:
|
||||
if arg in line:
|
||||
|
|
@ -365,12 +365,12 @@ def repackage_msix(
|
|||
second = next(values)
|
||||
vendor = vendor or second
|
||||
|
||||
# For `AppConstants.jsm` and `brand.properties`, which are in the omnijar in packaged builds.
|
||||
# The nested langpack XPI files can't be read by `mozjar.py`.
|
||||
# For `AppConstants.sys.mjs` and `brand.properties`, which are in the omnijar in packaged
|
||||
# builds. The nested langpack XPI files can't be read by `mozjar.py`.
|
||||
unpack_finder = UnpackFinder(finder, unpack_xpi=False)
|
||||
|
||||
if not version:
|
||||
values = get_appconstants_jsm_values(
|
||||
values = get_appconstants_sys_mjs_values(
|
||||
unpack_finder, "MOZ_APP_VERSION_DISPLAY", "MOZ_BUILDID"
|
||||
)
|
||||
display_version = next(values)
|
||||
|
|
@ -384,8 +384,8 @@ def repackage_msix(
|
|||
"display_version": display_version,
|
||||
"buildid": buildid,
|
||||
},
|
||||
"AppConstants.jsm display version is '{display_version}' and build ID is '{buildid}':"
|
||||
+ " embedded version will be '{version}'",
|
||||
"AppConstants.sys.mjs display version is '{display_version}' and build ID is"
|
||||
+ " '{buildid}': embedded version will be '{version}'",
|
||||
)
|
||||
|
||||
# TODO: Bug 1721922: localize this description via Fluent.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const backgroundtaskPhases = {
|
|||
"resource://gre/modules/AppConstants.jsm",
|
||||
"resource://gre/modules/AsyncShutdown.jsm",
|
||||
"resource://gre/modules/BackgroundTasksManager.sys.mjs",
|
||||
"resource://gre/modules/Console.jsm",
|
||||
"resource://gre/modules/Console.sys.mjs",
|
||||
"resource://gre/modules/EnterprisePolicies.sys.mjs",
|
||||
"resource://gre/modules/EnterprisePoliciesParent.sys.mjs",
|
||||
"resource://gre/modules/PromiseUtils.sys.mjs",
|
||||
|
|
@ -123,7 +123,7 @@ const backgroundtaskPhases = {
|
|||
"resource:///modules/backgroundtasks/BackgroundTask_wait.sys.mjs",
|
||||
|
||||
"resource://gre/modules/ConsoleAPIStorage.jsm",
|
||||
"resource://gre/modules/Timer.jsm",
|
||||
"resource://gre/modules/Timer.sys.mjs",
|
||||
|
||||
// We have a profile marker for this, even though it failed to load!
|
||||
"resource://gre/modules/backgroundtasks/BackgroundTask_wait.sys.mjs",
|
||||
|
|
|
|||
|
|
@ -2,21 +2,14 @@
|
|||
/* 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";
|
||||
|
||||
/**
|
||||
* This module handles JavaScript-implemented JSWindowActors, registered through DOM IPC
|
||||
* infrastructure, and are fission-compatible.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ActorManagerParent"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
/**
|
||||
* Fission-compatible JSProcess implementations.
|
||||
|
|
@ -569,7 +562,7 @@ if (AppConstants.platform != "android") {
|
|||
};
|
||||
}
|
||||
|
||||
var ActorManagerParent = {
|
||||
export var ActorManagerParent = {
|
||||
_addActors(actors, kind) {
|
||||
let register, unregister;
|
||||
switch (kind) {
|
||||
|
|
@ -5,15 +5,11 @@
|
|||
* 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 lazy = {};
|
||||
ChromeUtils.defineModuleGetter(lazy, "AddonManager", "resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["AppConstants"];
|
||||
|
||||
// Immutable for export.
|
||||
var AppConstants = Object.freeze({
|
||||
export var AppConstants = Object.freeze({
|
||||
// See this wiki page for more details about channel specific build
|
||||
// defines: https://wiki.mozilla.org/Platform/Channel-specific_build_defines
|
||||
NIGHTLY_BUILD:
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
* 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";
|
||||
|
||||
/**
|
||||
* Define a 'console' API to roughly match the implementation provided by
|
||||
* Firebug.
|
||||
|
|
@ -20,8 +18,6 @@
|
|||
* implementation isn't always required (or even well defined)
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["console", "ConsoleAPI"];
|
||||
|
||||
var gTimerRegistry = new Map();
|
||||
|
||||
/**
|
||||
|
|
@ -610,7 +606,7 @@ function sendConsoleAPIMessage(aConsole, aLevel, aFrame, aArgs, aOptions = {}) {
|
|||
* @return {object}
|
||||
* A console API instance object
|
||||
*/
|
||||
function ConsoleAPI(aConsoleOptions = {}) {
|
||||
export function ConsoleAPI(aConsoleOptions = {}) {
|
||||
// Normalize console options to set default values
|
||||
// in order to avoid runtime checks on each console method call.
|
||||
this.dump = aConsoleOptions.dump || dump;
|
||||
|
|
@ -756,4 +752,4 @@ ConsoleAPI.prototype = {
|
|||
},
|
||||
};
|
||||
|
||||
var console = new ConsoleAPI();
|
||||
export var console = new ConsoleAPI();
|
||||
|
|
@ -14,11 +14,7 @@
|
|||
* between processes during runtime.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ContentDOMReference"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
@ -55,7 +51,7 @@ const finalizerRoots = new WeakMap();
|
|||
*/
|
||||
var gRegistry = new WeakMap();
|
||||
|
||||
var ContentDOMReference = {
|
||||
export var ContentDOMReference = {
|
||||
_init() {
|
||||
Services.obs.addObserver(this, FINALIZATION_TOPIC);
|
||||
},
|
||||
|
|
@ -4,10 +4,6 @@
|
|||
* 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 = ["DeferredTask"];
|
||||
|
||||
const lazy = {};
|
||||
|
||||
/**
|
||||
|
|
@ -114,7 +110,7 @@ const Timer = Components.Constructor(
|
|||
* aDelayMs have elapsed. If omitted, waits indefinitely for an idle
|
||||
* callback.
|
||||
*/
|
||||
var DeferredTask = function(aTaskFn, aDelayMs, aIdleTimeoutMs) {
|
||||
export var DeferredTask = function(aTaskFn, aDelayMs, aIdleTimeoutMs) {
|
||||
this._taskFn = aTaskFn;
|
||||
this._delayMs = aDelayMs;
|
||||
this._timeoutMs = aIdleTimeoutMs;
|
||||
|
|
@ -2,10 +2,6 @@
|
|||
* 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 = ["Deprecated"];
|
||||
|
||||
const PREF_DEPRECATION_WARNINGS = "devtools.errorconsole.deprecation_warnings";
|
||||
|
||||
// A flag that indicates whether deprecation warnings should be logged.
|
||||
|
|
@ -43,7 +39,7 @@ function stringifyCallstack(aStack) {
|
|||
return msg;
|
||||
}
|
||||
|
||||
var Deprecated = {
|
||||
export var Deprecated = {
|
||||
/**
|
||||
* Log a deprecation warning.
|
||||
*
|
||||
|
|
@ -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 = ["E10SUtils"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
@ -269,7 +263,7 @@ const SYSTEM_WORKERS_REMOTE_TYPES_ALLOWED = [
|
|||
PRIVILEGEDABOUT_REMOTE_TYPE,
|
||||
];
|
||||
|
||||
var E10SUtils = {
|
||||
export var E10SUtils = {
|
||||
DEFAULT_REMOTE_TYPE,
|
||||
NOT_REMOTE,
|
||||
WEB_REMOTE_TYPE,
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
* 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 lazy = {};
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
|
|
@ -12,9 +10,7 @@ ChromeUtils.defineModuleGetter(
|
|||
"resource://gre/modules/Console.jsm"
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["EventEmitter"];
|
||||
|
||||
function EventEmitter() {}
|
||||
export function EventEmitter() {}
|
||||
|
||||
let loggingEnabled = Services.prefs.getBoolPref("toolkit.dump.emit");
|
||||
Services.prefs.addObserver("toolkit.dump.emit", {
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
* 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 = ["Preferences"];
|
||||
|
||||
// The minimum and maximum integers that can be set as preferences.
|
||||
// The range of valid values is narrower than the range of valid JS values
|
||||
// because the native preferences code treats integers as NSPR PRInt32s,
|
||||
|
|
@ -11,7 +9,7 @@ var EXPORTED_SYMBOLS = ["Preferences"];
|
|||
const MAX_INT = 0x7fffffff; // Math.pow(2, 31) - 1
|
||||
const MIN_INT = -0x80000000;
|
||||
|
||||
function Preferences(args) {
|
||||
export function Preferences(args) {
|
||||
this._cachedPrefBranch = null;
|
||||
if (isObject(args)) {
|
||||
if (args.branch) {
|
||||
|
|
@ -2,15 +2,13 @@
|
|||
* 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 = ["PrivateBrowsingUtils"];
|
||||
|
||||
const kAutoStartPref = "browser.privatebrowsing.autostart";
|
||||
|
||||
// This will be set to true when the PB mode is autostarted from the command
|
||||
// line for the current session.
|
||||
var gTemporaryAutoStartMode = false;
|
||||
|
||||
var PrivateBrowsingUtils = {
|
||||
export var PrivateBrowsingUtils = {
|
||||
get enabled() {
|
||||
return Services.policies.isAllowed("privatebrowsing");
|
||||
},
|
||||
|
|
@ -2,23 +2,10 @@
|
|||
* 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";
|
||||
|
||||
/**
|
||||
* JS module implementation of setTimeout and clearTimeout.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = [
|
||||
"setTimeout",
|
||||
"setTimeoutWithTarget",
|
||||
"clearTimeout",
|
||||
"setInterval",
|
||||
"setIntervalWithTarget",
|
||||
"clearInterval",
|
||||
"requestIdleCallback",
|
||||
"cancelIdleCallback",
|
||||
];
|
||||
|
||||
// This gives us >=2^30 unique timer IDs, enough for 1 per ms for 12.4 days.
|
||||
var gNextId = 1; // setTimeout and setInterval must return a positive integer
|
||||
|
||||
|
|
@ -78,11 +65,16 @@ function _setTimeoutOrIsInterval(
|
|||
return id;
|
||||
}
|
||||
|
||||
function setTimeout(aCallback, aMilliseconds, ...aArgs) {
|
||||
export function setTimeout(aCallback, aMilliseconds, ...aArgs) {
|
||||
return _setTimeoutOrIsInterval(aCallback, aMilliseconds, false, null, aArgs);
|
||||
}
|
||||
|
||||
function setTimeoutWithTarget(aCallback, aMilliseconds, aTarget, ...aArgs) {
|
||||
export function setTimeoutWithTarget(
|
||||
aCallback,
|
||||
aMilliseconds,
|
||||
aTarget,
|
||||
...aArgs
|
||||
) {
|
||||
return _setTimeoutOrIsInterval(
|
||||
aCallback,
|
||||
aMilliseconds,
|
||||
|
|
@ -92,11 +84,16 @@ function setTimeoutWithTarget(aCallback, aMilliseconds, aTarget, ...aArgs) {
|
|||
);
|
||||
}
|
||||
|
||||
function setInterval(aCallback, aMilliseconds, ...aArgs) {
|
||||
export function setInterval(aCallback, aMilliseconds, ...aArgs) {
|
||||
return _setTimeoutOrIsInterval(aCallback, aMilliseconds, true, null, aArgs);
|
||||
}
|
||||
|
||||
function setIntervalWithTarget(aCallback, aMilliseconds, aTarget, ...aArgs) {
|
||||
export function setIntervalWithTarget(
|
||||
aCallback,
|
||||
aMilliseconds,
|
||||
aTarget,
|
||||
...aArgs
|
||||
) {
|
||||
return _setTimeoutOrIsInterval(
|
||||
aCallback,
|
||||
aMilliseconds,
|
||||
|
|
@ -112,10 +109,10 @@ function clear(aId) {
|
|||
gTimerTable.delete(aId);
|
||||
}
|
||||
}
|
||||
var clearInterval = clear;
|
||||
var clearTimeout = clear;
|
||||
export var clearInterval = clear;
|
||||
export var clearTimeout = clear;
|
||||
|
||||
function requestIdleCallback(aCallback, aOptions) {
|
||||
export function requestIdleCallback(aCallback, aOptions) {
|
||||
if (typeof aCallback !== "function") {
|
||||
throw new Error("callback is not a function in requestIdleCallback");
|
||||
}
|
||||
|
|
@ -133,7 +130,7 @@ function requestIdleCallback(aCallback, aOptions) {
|
|||
return id;
|
||||
}
|
||||
|
||||
function cancelIdleCallback(aId) {
|
||||
export function cancelIdleCallback(aId) {
|
||||
if (gTimerTable.has(aId)) {
|
||||
gTimerTable.delete(aId);
|
||||
}
|
||||
|
|
@ -7,8 +7,6 @@
|
|||
* to create a two-way communication channel between chrome and content code.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["WebChannel", "WebChannelBroker"];
|
||||
|
||||
const ERRNO_UNKNOWN_ERROR = 999;
|
||||
const ERROR_UNKNOWN = "UNKNOWN_ERROR";
|
||||
|
||||
|
|
@ -17,7 +15,7 @@ const ERROR_UNKNOWN = "UNKNOWN_ERROR";
|
|||
* This object handles channel registration, origin validation and message multiplexing.
|
||||
*/
|
||||
|
||||
var WebChannelBroker = Object.create({
|
||||
export var WebChannelBroker = Object.create({
|
||||
/**
|
||||
* Register a new channel that callbacks messages
|
||||
* based on proper origin and channel name
|
||||
|
|
@ -86,7 +84,7 @@ var WebChannelBroker = Object.create({
|
|||
* permission manager.
|
||||
* @constructor
|
||||
*/
|
||||
var WebChannel = function(id, originOrPermission) {
|
||||
export var WebChannel = function(id, originOrPermission) {
|
||||
if (!id || !originOrPermission) {
|
||||
throw new Error("WebChannel id and originOrPermission are required.");
|
||||
}
|
||||
|
|
@ -54,16 +54,16 @@ with Files("AsanReporter.sys.mjs"):
|
|||
with Files("Color.sys.mjs"):
|
||||
BUG_COMPONENT = ("Toolkit", "Find Toolbar")
|
||||
|
||||
with Files("Console.jsm"):
|
||||
with Files("Console.sys.mjs"):
|
||||
BUG_COMPONENT = ("DevTools", "Console")
|
||||
|
||||
with Files("DateTimePicker*.jsm"):
|
||||
BUG_COMPONENT = ("Core", "Layout: Form Controls")
|
||||
|
||||
with Files("DeferredTask.jsm"):
|
||||
with Files("DeferredTask.sys.mjs"):
|
||||
BUG_COMPONENT = ("Toolkit", "Async Tooling")
|
||||
|
||||
with Files("E10SUtils.jsm"):
|
||||
with Files("E10SUtils.sys.mjs"):
|
||||
BUG_COMPONENT = ("Core", "Security: Process Sandboxing")
|
||||
|
||||
with Files("nsIE10SUtils.idl"):
|
||||
|
|
@ -105,7 +105,7 @@ with Files("PermissionsUtils.sys.mjs"):
|
|||
with Files("PopupNotifications.sys.mjs"):
|
||||
BUG_COMPONENT = ("Toolkit", "Notifications and Alerts")
|
||||
|
||||
with Files("PrivateBrowsingUtils.jsm"):
|
||||
with Files("PrivateBrowsingUtils.sys.mjs"):
|
||||
BUG_COMPONENT = ("Firefox", "Private Browsing")
|
||||
|
||||
with Files("Promise*.jsm"):
|
||||
|
|
@ -149,7 +149,7 @@ with Files("docs/**"):
|
|||
|
||||
EXTRA_JS_MODULES += [
|
||||
"AboutPagesUtils.sys.mjs",
|
||||
"ActorManagerParent.jsm",
|
||||
"ActorManagerParent.sys.mjs",
|
||||
"AppMenuNotifications.sys.mjs",
|
||||
"AsyncPrefs.sys.mjs",
|
||||
"BinarySearch.sys.mjs",
|
||||
|
|
@ -158,14 +158,14 @@ EXTRA_JS_MODULES += [
|
|||
"CanonicalJSON.jsm",
|
||||
"CertUtils.sys.mjs",
|
||||
"Color.sys.mjs",
|
||||
"Console.jsm",
|
||||
"ContentDOMReference.jsm",
|
||||
"Console.sys.mjs",
|
||||
"ContentDOMReference.sys.mjs",
|
||||
"CreditCard.sys.mjs",
|
||||
"DateTimePickerPanel.sys.mjs",
|
||||
"DeferredTask.jsm",
|
||||
"Deprecated.jsm",
|
||||
"E10SUtils.jsm",
|
||||
"EventEmitter.jsm",
|
||||
"DeferredTask.sys.mjs",
|
||||
"Deprecated.sys.mjs",
|
||||
"E10SUtils.sys.mjs",
|
||||
"EventEmitter.sys.mjs",
|
||||
"FileUtils.sys.mjs",
|
||||
"FindBarContent.sys.mjs",
|
||||
"Finder.sys.mjs",
|
||||
|
|
@ -194,8 +194,8 @@ EXTRA_JS_MODULES += [
|
|||
"OSKeyStore.sys.mjs",
|
||||
"PermissionsUtils.sys.mjs",
|
||||
"PopupNotifications.sys.mjs",
|
||||
"Preferences.jsm",
|
||||
"PrivateBrowsingUtils.jsm",
|
||||
"Preferences.sys.mjs",
|
||||
"PrivateBrowsingUtils.sys.mjs",
|
||||
"ProcessType.sys.mjs",
|
||||
"ProfileAge.sys.mjs",
|
||||
"PromiseUtils.sys.mjs",
|
||||
|
|
@ -209,10 +209,10 @@ EXTRA_JS_MODULES += [
|
|||
"ShortcutUtils.sys.mjs",
|
||||
"Sqlite.sys.mjs",
|
||||
"SubDialog.sys.mjs",
|
||||
"Timer.jsm",
|
||||
"Timer.sys.mjs",
|
||||
"Troubleshoot.sys.mjs",
|
||||
"UpdateUtils.sys.mjs",
|
||||
"WebChannel.jsm",
|
||||
"WebChannel.sys.mjs",
|
||||
]
|
||||
|
||||
if CONFIG["MOZ_ASAN_REPORTER"]:
|
||||
|
|
@ -242,7 +242,7 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk", "cocoa"):
|
|||
DEFINES["HAVE_SHELL_SERVICE"] = 1
|
||||
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
"AppConstants.jsm",
|
||||
"AppConstants.sys.mjs",
|
||||
]
|
||||
|
||||
if "Android" != CONFIG["OS_TARGET"]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue