Bug 1517653 - part 0b - only initialize layout if we load chrome manifests; r=mccr8
authorNathan Froyd <froydnj@mozilla.com>
Tue, 08 Jan 2019 15:56:58 -0500
changeset 510081 08438a0f4757ad2d483a29d3fbd89ff86a827f27
parent 510080 9aaacc4c6149f3f54880e535e4a89dd4787e0ca1
child 510082 4eee7eae9a4d4418d6b739da1e36a484f57241ce
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1517653
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1517653 - part 0b - only initialize layout if we load chrome manifests; r=mccr8 The layout module initializes a bunch of things, specifically XPConnect. And if we're not loading chrome manifests, we shouldn't need to initialize the layout module.
xpcom/components/nsComponentManager.cpp
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -329,20 +329,16 @@ nsresult nsComponentManagerImpl::Init() 
       RegisterModule(module);
     }
   }
 
   for (uint32_t i = 0; i < sExtraStaticModules->Length(); ++i) {
     RegisterModule((*sExtraStaticModules)[i]);
   }
 
-  // This needs to be called very early, before anything in nsLayoutModule is
-  // used, and before any calls are made into the JS engine.
-  nsLayoutModuleInitialize();
-
   bool loadChromeManifests;
   switch (XRE_GetProcessType()) {
     // We are going to assume that only a select few (see below) process types
     // want to load chrome manifests, and that any new process types will not
     // want to load them, because they're not going to be executing JS.
     default:
       loadChromeManifests = false;
       break;
@@ -355,16 +351,20 @@ nsresult nsComponentManagerImpl::Init() 
     case GeckoProcessType_Content:
     case GeckoProcessType_IPDLUnitTest:
     case GeckoProcessType_GMPlugin:
       loadChromeManifests = true;
       break;
   }
 
   if (loadChromeManifests) {
+    // This needs to be called very early, before anything in nsLayoutModule is
+    // used, and before any calls are made into the JS engine.
+    nsLayoutModuleInitialize();
+
     // The overall order in which chrome.manifests are expected to be treated
     // is the following:
     // - greDir
     // - greDir's omni.ja
     // - appDir
     // - appDir's omni.ja
 
     InitializeModuleLocations();