mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1733485 - Lazy load modules in GMPUtils.jsm, UpdateUtils.jsm, GMPProvider.jsm to avoid loading earlier than necessary. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D127171
This commit is contained in:
parent
7ee3993e66
commit
aec46f6b9d
@ -12,11 +12,19 @@ var EXPORTED_SYMBOLS = [
|
||||
"WIDEVINE_ID",
|
||||
];
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"Services",
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
const { UpdateUtils } = ChromeUtils.import(
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"UpdateUtils",
|
||||
"resource://gre/modules/UpdateUtils.jsm"
|
||||
);
|
||||
|
||||
|
@ -5,30 +5,22 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = ["UpdateUtils"];
|
||||
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { XPCOMUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/XPCOMUtils.jsm"
|
||||
);
|
||||
const { FileUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/FileUtils.jsm"
|
||||
);
|
||||
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
const { ctypes } = ChromeUtils.import("resource://gre/modules/ctypes.jsm");
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"WindowsVersionInfo",
|
||||
"resource://gre/modules/components-utils/WindowsVersionInfo.jsm"
|
||||
);
|
||||
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); /* globals fetch */
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"WindowsRegistry",
|
||||
"resource://gre/modules/WindowsRegistry.jsm"
|
||||
);
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
ctypes: "resource://gre/modules/ctypes.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
|
||||
WindowsVersionInfo:
|
||||
"resource://gre/modules/components-utils/WindowsVersionInfo.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
|
||||
|
||||
const PER_INSTALLATION_PREFS_PLATFORMS = ["win"];
|
||||
|
||||
|
@ -9,30 +9,22 @@ var EXPORTED_SYMBOLS = [];
|
||||
const { XPCOMUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/XPCOMUtils.jsm"
|
||||
);
|
||||
const { AddonManager, AddonManagerPrivate } = ChromeUtils.import(
|
||||
"resource://gre/modules/AddonManager.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm",
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
Log: "resource://gre/modules/Log.jsm",
|
||||
GMPInstallManager: "resource://gre/modules/GMPInstallManager.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
});
|
||||
|
||||
// These symbols are, unfortunately, accessed via the module global from
|
||||
// tests, and therefore cannot be lexical definitions.
|
||||
var { GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID } = ChromeUtils.import(
|
||||
"resource://gre/modules/GMPUtils.jsm"
|
||||
);
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"GMPInstallManager",
|
||||
"resource://gre/modules/GMPInstallManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"setTimeout",
|
||||
"resource://gre/modules/Timer.jsm"
|
||||
);
|
||||
|
||||
const URI_EXTENSION_STRINGS =
|
||||
"chrome://mozapps/locale/extensions/extensions.properties";
|
||||
|
Loading…
Reference in New Issue
Block a user