зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1787724 - Migrate GMPProvider.jsm to system ES module. r=rpl,arai.
This patch is the result of `mach esmify --convert toolkit/mozapps/extensions/internal/GMPProvider.jsm`. Callsites were fixed manually, as well as occasional references in comments. Differential Revision: https://phabricator.services.mozilla.com/D155832
This commit is contained in:
Родитель
b59649bf10
Коммит
4ef6742cb2
|
@ -708,7 +708,7 @@ var AddonManagerInternal = {
|
|||
CATEGORY_PROVIDER_MODULE
|
||||
)) {
|
||||
try {
|
||||
ChromeUtils.import(url);
|
||||
ChromeUtils.importESModule(url);
|
||||
logger.debug(`Loaded provider scope for ${url}`);
|
||||
} catch (e) {
|
||||
AddonManagerPrivate.recordException(
|
||||
|
|
|
@ -89,7 +89,7 @@ const kRegExpRemovalRegExp = /^\/\^\(\(?|\\|\)\)?\$\/$/g;
|
|||
// providers that differ from the existing types.
|
||||
XPCOMUtils.defineLazyGetter(lazy, "kXPIAddonTypes", () => {
|
||||
// In practice, this result is equivalent to ALL_XPI_TYPES in XPIProvider.jsm.
|
||||
// "plugin" (from GMPProvider.jsm) is intentionally omitted, as we decided to
|
||||
// "plugin" (from GMPProvider.sys.mjs) is intentionally omitted, as we decided to
|
||||
// not support blocklisting of GMP plugins in bug 1086668.
|
||||
return lazy.AddonManagerPrivate.getAddonTypesByProvider("XPIProvider");
|
||||
});
|
||||
|
|
|
@ -3,6 +3,6 @@ category update-timer addonManager @mozilla.org/addons/integration;1,getService,
|
|||
#endif
|
||||
#ifndef MOZ_THUNDERBIRD
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm
|
||||
category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.sys.mjs
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -4,11 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["GMPTestUtils"];
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
|
@ -880,7 +877,7 @@ var GMPProvider = {
|
|||
GMPProvider.addObserver();
|
||||
|
||||
// For test use only.
|
||||
const GMPTestUtils = {
|
||||
export const GMPTestUtils = {
|
||||
/**
|
||||
* Used to override the GMP service with a mock.
|
||||
*
|
|
@ -16,7 +16,7 @@ EXTRA_JS_MODULES.addons += [
|
|||
|
||||
if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
|
||||
EXTRA_JS_MODULES.addons += [
|
||||
"GMPProvider.jsm",
|
||||
"GMPProvider.sys.mjs",
|
||||
]
|
||||
|
||||
TESTING_JS_MODULES += [
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { GMPTestUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/addons/GMPProvider.jsm"
|
||||
const { GMPTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/addons/GMPProvider.sys.mjs"
|
||||
);
|
||||
const { GMPInstallManager } = ChromeUtils.import(
|
||||
"resource://gre/modules/GMPInstallManager.jsm"
|
||||
|
|
Загрузка…
Ссылка в новой задаче