Bug 542053 - OOPP do not work in XR builds. Use NS_GRE_DIR when determining exe path of child process. r=bsmedberg

--HG--
extra : rebase_source : abc95f4e1b496b552caa1341ef4b72534c43d3ee
This commit is contained in:
Doug Turner 2010-03-15 10:08:27 -07:00
parent 11ea6fcf6a
commit 260400726a
2 changed files with 19 additions and 2 deletions

View File

@ -179,8 +179,22 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
// and passing wstrings from one config to the other is unsafe. So
// we split the logic here.
FilePath exePath = FilePath(CommandLine::ForCurrentProcess()->argv()[0]);
exePath = exePath.DirName();
FilePath exePath;
nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
nsCOMPtr<nsIFile> greDir;
nsresult rv = directoryService->Get(NS_GRE_DIR, NS_GET_IID(nsIFile), getter_AddRefs(greDir));
if (NS_SUCCEEDED(rv))
{
nsCString path;
greDir->GetNativePath(path);
exePath = FilePath(path.get());
}
else
{
exePath = FilePath(CommandLine::ForCurrentProcess()->argv()[0]);
exePath = exePath.DirName();
}
exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_NAME);
// remap the IPC socket fd to a well-known int, as the OS does for

View File

@ -47,6 +47,9 @@
#include "nsXULAppAPI.h" // for GeckoProcessType
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
namespace mozilla {
namespace ipc {