Bug 968774 - Don't set XUL_APP_FILE on metrofx startup. r=mbrubeck, a=sledru
authorJim Mathies <jmathies@mozilla.com>
Thu, 06 Feb 2014 17:41:13 -0600
changeset 176282 ce8d8b1b97a8213334d77e66b56bb98968e670ba
parent 176281 4b2f78c2d884d5fdea7b5e1ef7acc9ddeedda08d
child 176283 16a356b130577b4cbb7996b1ca870d912a8a9dee
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, sledru
bugs968774
milestone28.0
Bug 968774 - Don't set XUL_APP_FILE on metrofx startup. r=mbrubeck, a=sledru
browser/app/nsBrowserApp.cpp
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -236,27 +236,29 @@ static int do_main(int argc, char* argv[
       argv[1] = argv[0];
       argv++;
       argc--;
     } else if (IsArg(argv[1], "BackgroundSessionClosed")) {
       // This command line flag is used for indirect shutdowns, the OS
       // relaunches Metro Firefox with this command line arg.
       mainFlags = XRE_MAIN_FLAG_USE_METRO;
     } else {
+#ifndef RELEASE_BUILD
       // This command-line flag is used to test the metro browser in a desktop
       // environment.
       for (int idx = 1; idx < argc; idx++) {
         if (IsArg(argv[idx], "metrodesktop")) {
           metroOnDesktop = true;
           // Disable crash reporting when running in metrodesktop mode.
           char crashSwitch[] = "MOZ_CRASHREPORTER_DISABLE=1";
           putenv(crashSwitch);
           break;
         } 
       }
+#endif
     }
   }
 #endif
 
   // Desktop browser launch
   if (mainFlags != XRE_MAIN_FLAG_USE_METRO && !metroOnDesktop) {
     ScopedAppData appData(&sAppData);
     nsCOMPtr<nsIFile> exeFile;
@@ -293,23 +295,16 @@ static int do_main(int argc, char* argv[
   appSubdir->Append(NS_LITERAL_STRING(kMetroFolder));
 
   nsAutoCString path;
   if (NS_FAILED(iniFile->GetNativePath(path))) {
     Output("Couldn't get ini file path.\n");
     return 255;
   }
 
-  char appEnv[MAXPATHLEN];
-  snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", path.get());
-  if (putenv(appEnv)) {
-    Output("Couldn't set %s.\n", appEnv);
-    return 255;
-  }
-
   nsXREAppData *appData;
   rv = XRE_CreateAppData(iniFile, &appData);
   if (NS_FAILED(rv) || !appData) {
     Output("Couldn't read application.ini");
     return 255;
   }
 
   SetStrongPtr(appData->directory, static_cast<nsIFile*>(appSubdir.get()));