Bug 1404470 - Port
Bug 1403366 to C-C. Remove argv[0] parameter from XRE_GetBinaryPath. r=jorgk a=frg (SM CLOSED TREE)
--- a/im/app/nsMain.cpp
+++ b/im/app/nsMain.cpp
@@ -228,19 +228,19 @@ static int do_main(int argc, char* argv[
if (getenv("LIBFUZZER"))
gBootstrap->XRE_LibFuzzerSetDriver(fuzzer::FuzzerDriver);
#endif
return gBootstrap->XRE_main(argc, argv, config);
}
static nsresult
-InitXPCOMGlue(const char *argv0)
+InitXPCOMGlue()
{
- UniqueFreePtr<char> exePath = BinaryPath::Get(argv0);
+ UniqueFreePtr<char> exePath = BinaryPath::Get();
if (!exePath) {
Output("Couldn't find the application directory.\n");
return NS_ERROR_FAILURE;
}
gBootstrap = mozilla::GetBootstrap(exePath.get());
if (!gBootstrap) {
Output("Couldn't load XPCOM.\n");
@@ -268,17 +268,17 @@ int main(int argc, char* argv[], char* e
// We need to initialize the sandbox TargetServices before InitXPCOMGlue
// because we might need the sandbox broker to give access to some files.
if (IsSandboxedProcess() && !sandboxing::GetInitializedTargetServices()) {
Output("Failed to initialize the sandbox target services.");
return 255;
}
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
int result = content_process_main(gBootstrap.get(), argc, argv);
// InitXPCOMGlue calls NS_LogInit, so we need to balance it here.
gBootstrap->NS_LogTerm();
@@ -287,17 +287,17 @@ int main(int argc, char* argv[], char* e
}
#endif
#ifdef HAS_DLL_BLOCKLIST
DllBlocklist_Initialize();
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
gBootstrap->XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
gBootstrap->XRE_EnableSameExecutableForContentProc();
--- a/mail/app/nsMailApp.cpp
+++ b/mail/app/nsMailApp.cpp
@@ -228,19 +228,19 @@ static int do_main(int argc, char* argv[
if (getenv("LIBFUZZER"))
gBootstrap->XRE_LibFuzzerSetDriver(fuzzer::FuzzerDriver);
#endif
return gBootstrap->XRE_main(argc, argv, config);
}
static nsresult
-InitXPCOMGlue(const char *argv0)
+InitXPCOMGlue()
{
- UniqueFreePtr<char> exePath = BinaryPath::Get(argv0);
+ UniqueFreePtr<char> exePath = BinaryPath::Get();
if (!exePath) {
Output("Couldn't find the application directory.\n");
return NS_ERROR_FAILURE;
}
gBootstrap = mozilla::GetBootstrap(exePath.get());
if (!gBootstrap) {
Output("Couldn't load XPCOM.\n");
@@ -268,17 +268,17 @@ int main(int argc, char* argv[], char* e
// We need to initialize the sandbox TargetServices before InitXPCOMGlue
// because we might need the sandbox broker to give access to some files.
if (IsSandboxedProcess() && !sandboxing::GetInitializedTargetServices()) {
Output("Failed to initialize the sandbox target services.");
return 255;
}
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
int result = content_process_main(gBootstrap.get(), argc, argv);
// InitXPCOMGlue calls NS_LogInit, so we need to balance it here.
gBootstrap->NS_LogTerm();
@@ -287,17 +287,17 @@ int main(int argc, char* argv[], char* e
}
#endif
#ifdef HAS_DLL_BLOCKLIST
DllBlocklist_Initialize();
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
gBootstrap->XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
gBootstrap->XRE_EnableSameExecutableForContentProc();
--- a/suite/app/nsSuiteApp.cpp
+++ b/suite/app/nsSuiteApp.cpp
@@ -228,19 +228,19 @@ static int do_main(int argc, char* argv[
if (getenv("LIBFUZZER"))
gBootstrap->XRE_LibFuzzerSetDriver(fuzzer::FuzzerDriver);
#endif
return gBootstrap->XRE_main(argc, argv, config);
}
static nsresult
-InitXPCOMGlue(const char *argv0)
+InitXPCOMGlue()
{
- UniqueFreePtr<char> exePath = BinaryPath::Get(argv0);
+ UniqueFreePtr<char> exePath = BinaryPath::Get();
if (!exePath) {
Output("Couldn't find the application directory.\n");
return NS_ERROR_FAILURE;
}
gBootstrap = mozilla::GetBootstrap(exePath.get());
if (!gBootstrap) {
Output("Couldn't load XPCOM.\n");
@@ -268,17 +268,17 @@ int main(int argc, char* argv[], char* e
// We need to initialize the sandbox TargetServices before InitXPCOMGlue
// because we might need the sandbox broker to give access to some files.
if (IsSandboxedProcess() && !sandboxing::GetInitializedTargetServices()) {
Output("Failed to initialize the sandbox target services.");
return 255;
}
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
int result = content_process_main(gBootstrap.get(), argc, argv);
// InitXPCOMGlue calls NS_LogInit, so we need to balance it here.
gBootstrap->NS_LogTerm();
@@ -287,17 +287,17 @@ int main(int argc, char* argv[], char* e
}
#endif
#ifdef HAS_DLL_BLOCKLIST
DllBlocklist_Initialize();
#endif
- nsresult rv = InitXPCOMGlue(argv[0]);
+ nsresult rv = InitXPCOMGlue();
if (NS_FAILED(rv)) {
return 255;
}
gBootstrap->XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
gBootstrap->XRE_EnableSameExecutableForContentProc();