Bug 1543761 - stop reading chrome.manifest files in the app/gre dirs when using omni.ja, r=glandium
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 15 May 2019 12:36:31 +0000
changeset 532742 55d8ca64343b8c2c725ace70eed4e002b775f795
parent 532741 10571a393265c39d8b42627b2f0a3c0c2c79f842
child 532743 59ae39ef8edf171b0ef5417e74402ae233f71dc4
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1543761
milestone68.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 1543761 - stop reading chrome.manifest files in the app/gre dirs when using omni.ja, r=glandium Differential Revision: https://phabricator.services.mozilla.com/D29287
browser/base/content/test/performance/browser_startup_content_mainthreadio.js
browser/base/content/test/performance/browser_startup_mainthreadio.js
xpcom/components/nsComponentManager.cpp
--- a/browser/base/content/test/performance/browser_startup_content_mainthreadio.js
+++ b/browser/base/content/test/performance/browser_startup_content_mainthreadio.js
@@ -68,28 +68,16 @@ const processes = {
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
     { // bug 1376994
       path: "XCurProcD:omni.ja",
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
-    { // bug 1543761
-      path: "GreD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
-    { // bug 1376994, bug 1543761
-      path: "XCurProcD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
     { // Exists call in ScopedXREEmbed::SetAppDir
       path: "XCurProcD:",
       condition: WIN,
       stat: 1,
     },
     { // bug 1357205
       path: "XREAppFeat:webcompat@mozilla.org.xpi",
       condition: !WIN,
@@ -107,28 +95,16 @@ const processes = {
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
     { // bug 1376994
       path: "XCurProcD:omni.ja",
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
-    { // bug 1543761
-      path: "GreD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
-    { // bug 1376994, bug 1543761
-      path: "XCurProcD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
     { // Exists call in ScopedXREEmbed::SetAppDir
       path: "XCurProcD:",
       condition: WIN,
       stat: 1,
     },
     { // bug 1357205
       path: "XREAppFeat:webcompat@mozilla.org.xpi",
       condition: !WIN,
@@ -141,28 +117,16 @@ const processes = {
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
     { // bug 1376994
       path: "XCurProcD:omni.ja",
       condition: !WIN, // Visible on Windows with an open marker
       stat: 1,
     },
-    { // bug 1543761
-      path: "GreD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
-    { // bug 1376994, bug 1543761
-      path: "XCurProcD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
     { // Exists call in ScopedXREEmbed::SetAppDir
       path: "XCurProcD:",
       condition: WIN,
       stat: 1,
     },
     { // bug 1357205
       path: "XREAppFeat:webcompat@mozilla.org.xpi",
       condition: !WIN,
--- a/browser/base/content/test/performance/browser_startup_mainthreadio.js
+++ b/browser/base/content/test/performance/browser_startup_mainthreadio.js
@@ -195,28 +195,16 @@ const startupPhases = {
       stat: 1,
     },
     { // bug 1541601
       path: "PrfDef:channel-prefs.js",
       stat: 1,
       read: 1,
       close: 1,
     },
-    { // bug 1543761
-      path: "GreD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
-    { // bug 1376994, bug 1543761
-      path: "XCurProcD:chrome.manifest",
-      condition: !WIN, // Visible on Windows with an open marker
-      stat: 1,
-      close: 1,
-    },
     { // At least the read seems unavoidable
       path: "PrefD:prefs.js",
       stat: 1,
       read: 1,
       close: 1,
     },
     { // bug 1543752
       path: "PrefD:user.js",
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -491,51 +491,48 @@ nsresult nsComponentManagerImpl::Init() 
     // This needs to be called very early, before anything in nsLayoutModule is
     // used, and before any calls are made into the JS engine.
     nsLayoutModuleInitialize();
 
     mJSLoaderReady = true;
 
     // 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
+    // - greDir's omni.ja or greDir
+    // - appDir's omni.ja or appDir
 
     InitializeModuleLocations();
     ComponentLocation* cl = sModuleLocations->AppendElement();
-    nsCOMPtr<nsIFile> lf =
-        CloneAndAppend(greDir, NS_LITERAL_CSTRING("chrome.manifest"));
     cl->type = NS_APP_LOCATION;
-    cl->location.Init(lf);
-
     RefPtr<nsZipArchive> greOmnijar =
         mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE);
     if (greOmnijar) {
-      cl = sModuleLocations->AppendElement();
-      cl->type = NS_APP_LOCATION;
       cl->location.Init(greOmnijar, "chrome.manifest");
-    }
-
-    bool equals = false;
-    appDir->Equals(greDir, &equals);
-    if (!equals) {
-      cl = sModuleLocations->AppendElement();
-      cl->type = NS_APP_LOCATION;
-      lf = CloneAndAppend(appDir, NS_LITERAL_CSTRING("chrome.manifest"));
+    } else {
+      nsCOMPtr<nsIFile> lf =
+          CloneAndAppend(greDir, NS_LITERAL_CSTRING("chrome.manifest"));
       cl->location.Init(lf);
     }
 
     RefPtr<nsZipArchive> appOmnijar =
         mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
     if (appOmnijar) {
       cl = sModuleLocations->AppendElement();
       cl->type = NS_APP_LOCATION;
       cl->location.Init(appOmnijar, "chrome.manifest");
+    } else {
+      bool equals = false;
+      appDir->Equals(greDir, &equals);
+      if (!equals) {
+        cl = sModuleLocations->AppendElement();
+        cl->type = NS_APP_LOCATION;
+        nsCOMPtr<nsIFile> lf =
+            CloneAndAppend(appDir, NS_LITERAL_CSTRING("chrome.manifest"));
+        cl->location.Init(lf);
+      }
     }
 
     RereadChromeManifests(false);
   }
 
   nsCategoryManager::GetSingleton()->SuppressNotifications(false);
 
   RegisterWeakMemoryReporter(this);