Backed out changeset e531af57cd60 (bug 1321593)

This commit is contained in:
Sebastian Hengst 2016-12-12 22:09:40 +01:00
Родитель e82e4986eb
Коммит b65cbf32d8
1 изменённых файлов: 31 добавлений и 27 удалений

Просмотреть файл

@ -259,43 +259,47 @@ static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
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;
}
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));
#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
nsCOMPtr<nsIFile> appSubdir;
greDir->Clone(getter_AddRefs(appSubdir));
appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder));
appData.directory = appSubdir;
appData.xreDirectory = xreDirectory;
appini->GetParent(getter_AddRefs(appData.directory));
return XRE_main(argc, argv, appData, mainFlags);
}
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