From a8cef3c2305e9ed659439747c0b43bd7e1e5e4ec Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Mon, 27 Mar 2017 11:48:18 -0700 Subject: [PATCH] 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 --- dom/ipc/manifestMessages.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dom/ipc/manifestMessages.js b/dom/ipc/manifestMessages.js index 11b8627df248..f99d1be24e1a 100644 --- a/dom/ipc/manifestMessages.js +++ b/dom/ipc/manifestMessages.js @@ -16,11 +16,16 @@ const { utils: Cu, } = Components; -Cu.import("resource://gre/modules/ManifestObtainer.jsm"); -Cu.import("resource://gre/modules/ManifestFinder.jsm"); -Cu.import("resource://gre/modules/ManifestIcons.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.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 = { registerListeners() { addMessageListener(