Bug 1321593 part B - Unify the startup path between `firefox --app` and normal Firefox startup, r=glandium
☠☠ backed out by 0ca33efe1b83 ☠ ☠
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 02 Dec 2016 09:08:01 -0500
changeset 325653 e531af57cd60ba243721c90fc30fa47d6bdd37e0
parent 325652 eae2252a519f3ac5850f5110a6a1be45891ea5e9
child 325654 bd67a0d056e4554a2f3e76de4c2f23deda35dd4f
push id84751
push userbsmedberg@mozilla.com
push dateMon, 12 Dec 2016 20:07:05 +0000
treeherdermozilla-inbound@e531af57cd60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1321593
milestone53.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 1321593 part B - Unify the startup path between `firefox --app` and normal Firefox startup, r=glandium MozReview-Commit-ID: E6m3eWrX3aB
browser/app/nsBrowserApp.cpp
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -254,57 +254,53 @@ static int do_main(int argc, char* argv[
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
     shellData.sandboxBrokerServices =
       sandboxing::GetInitializedBrokerServices();
 #endif
 
     return XRE_XPCShellMain(--argc, argv, envp, &shellData);
   }
 
+  XREAppData appData;
+  appData.xreDirectory = xreDirectory;
+
   if (appini) {
-    XREAppData appData;
     rv = XRE_ParseAppData(appini, appData);
     if (NS_FAILED(rv)) {
       Output("Couldn't read application.ini");
       return 255;
     }
-#if defined(HAS_DLL_BLOCKLIST)
-    // The dll blocklist operates in the exe vs. xullib. Pass a flag to
-    // xullib so automated tests can check the result once the browser
-    // is up and running.
-    appData->flags |=
-      DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
+
+    appini->GetParent(getter_AddRefs(appData.directory));
+  } else {
+    // no -app flag so we use the compiled-in app data
+    appData = sAppData;
+
+    nsCOMPtr<nsIFile> exeFile;
+    rv = mozilla::BinaryPath::GetFile(argv[0], getter_AddRefs(exeFile));
+    if (NS_FAILED(rv)) {
+      Output("Couldn't find the application directory.\n");
+      return 255;
+    }
+
+    nsCOMPtr<nsIFile> greDir;
+    exeFile->GetParent(getter_AddRefs(greDir));
+#ifdef XP_MACOSX
+    greDir->SetNativeLeafName(NS_LITERAL_CSTRING(kOSXResourcesFolder));
 #endif
-    appData.xreDirectory = xreDirectory;
-    appini->GetParent(getter_AddRefs(appData.directory));
-    return XRE_main(argc, argv, appData, mainFlags);
+    nsCOMPtr<nsIFile> appSubdir;
+    greDir->Clone(getter_AddRefs(appSubdir));
+    appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder));
+    appData.directory = appSubdir;
   }
 
-  XREAppData appData;
-  appData = sAppData;
-  nsCOMPtr<nsIFile> exeFile;
-  rv = mozilla::BinaryPath::GetFile(argv[0], getter_AddRefs(exeFile));
-  if (NS_FAILED(rv)) {
-    Output("Couldn't find the application directory.\n");
-    return 255;
-  }
-
-  nsCOMPtr<nsIFile> greDir;
-  exeFile->GetParent(getter_AddRefs(greDir));
-#ifdef XP_MACOSX
-  greDir->SetNativeLeafName(NS_LITERAL_CSTRING(kOSXResourcesFolder));
-#endif
-  nsCOMPtr<nsIFile> appSubdir;
-  greDir->Clone(getter_AddRefs(appSubdir));
-  appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder));
-
-  appData.directory = appSubdir;
-  appData.xreDirectory = xreDirectory;
-
 #if defined(HAS_DLL_BLOCKLIST)
+  // The dll blocklist operates in the exe vs. xullib. Pass a flag to
+  // xullib so automated tests can check the result once the browser
+  // is up and running.
   appData.flags |=
     DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
 #endif
 
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   sandbox::BrokerServices* brokerServices =
     sandboxing::GetInitializedBrokerServices();
 #if defined(MOZ_CONTENT_SANDBOX)