Bug 1351008 - Lazily load Manifest jsms in manifestMessages.js. r=baku

This avoids loading 7 jsms until they are actually needed, reducing
content process memory usage.

MozReview-Commit-ID: 8ukNr7PL80A

--HG--
extra : rebase_source : a926a19645ffcacadec93ecc79927d356d603114
This commit is contained in:
Andrew McCreight 2017-03-27 11:48:18 -07:00
Родитель 935d22e0f2
Коммит a8cef3c230
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -16,11 +16,16 @@
const { const {
utils: Cu, utils: Cu,
} = Components; } = Components;
Cu.import("resource://gre/modules/ManifestObtainer.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/ManifestFinder.jsm");
Cu.import("resource://gre/modules/ManifestIcons.jsm");
Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ManifestObtainer",
"resource://gre/modules/ManifestObtainer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ManifestFinder",
"resource://gre/modules/ManifestFinder.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ManifestIcons",
"resource://gre/modules/ManifestIcons.jsm");
const MessageHandler = { const MessageHandler = {
registerListeners() { registerListeners() {
addMessageListener( addMessageListener(