Backed out changeset b80e267bdf30 (bug 1390488)

This commit is contained in:
Sebastian Hengst 2017-09-13 16:36:56 +02:00
parent dfce75fd9a
commit 3066457971
4 changed files with 3 additions and 62 deletions

View File

@ -861,18 +861,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
// Add the application directory path (-appdir path)
AddAppDirToCommandLine(childArgv);
// Tmp dir that the GPU process should use for crash reports. This arg is
// always populated (but possibly with an empty value) for a GPU child process.
if (mProcessType == GeckoProcessType_GPU) {
nsCOMPtr<nsIFile> file;
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
nsAutoCString path;
if (file) {
file->GetNativePath(path);
}
childArgv.push_back(path.get());
}
childArgv.push_back(pidstring);
# if defined(MOZ_CRASHREPORTER)
@ -1116,19 +1104,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
// Win app model id
cmdLine.AppendLooseValue(mGroupId.get());
// Tmp dir that the GPU process should use for crash reports. This arg is
// always populated (but possibly with an empty value) for a GPU child process.
if (mProcessType == GeckoProcessType_GPU) {
nsCOMPtr<nsIFile> file;
CrashReporter::GetChildProcessTmpDir(getter_AddRefs(file));
nsString path;
if (file) {
MOZ_ALWAYS_SUCCEEDS(file->GetPath(path));
}
std::wstring wpath(path.get());
cmdLine.AppendLooseValue(wpath);
}
// Process id
cmdLine.AppendLooseValue(UTF8ToWide(pidstring));

View File

@ -3590,17 +3590,6 @@ OOPDeinit()
#endif
}
void
GetChildProcessTmpDir(nsIFile** aOutTmpDir)
{
MOZ_ASSERT(XRE_IsParentProcess());
#if (defined(XP_MACOSX) || defined(XP_WIN))
if (childProcessTmpDir) {
CreateFileFromPath(*childProcessTmpDir, aOutTmpDir);
}
#endif
}
#if defined(XP_WIN) || defined(XP_MACOSX)
// Parent-side API for children
const char*
@ -3755,14 +3744,9 @@ GetLastRunCrashID(nsAString& id)
#if defined(XP_WIN) || defined(XP_MACOSX)
void
InitChildProcessTmpDir(nsIFile* aDirOverride)
InitChildProcessTmpDir()
{
MOZ_ASSERT(!XRE_IsParentProcess());
if (aDirOverride) {
childProcessTmpDir = CreatePathFromFile(aDirOverride);
return;
}
// When retrieved by the child process, this will always resolve to the
// correct directory regardless of sandbox level.
nsCOMPtr<nsIFile> tmpDir;

View File

@ -217,10 +217,6 @@ bool CreateAdditionalChildMinidump(ProcessHandle childPid,
nsIFile* parentMinidump,
const nsACString& name);
// Parent-side API, returns the tmp dir for child processes to use, accounting
// for sandbox considerations.
void GetChildProcessTmpDir(nsIFile** aOutTmpDir);
# if defined(XP_WIN32) || defined(XP_MACOSX)
// Parent-side API for children
const char* GetChildNotificationPipe();
@ -251,7 +247,7 @@ void UnregisterInjectorCallback(DWORD processID);
// Child-side API
bool SetRemoteExceptionHandler(const nsACString& crashPipe);
void InitChildProcessTmpDir(nsIFile* aDirOverride = nullptr);
void InitChildProcessTmpDir();
# elif defined(XP_LINUX)
// Parent-side API for children

View File

@ -563,20 +563,6 @@ XRE_InitChildProcess(int aArgc,
base::ProcessId parentPID = strtol(parentPIDString, &end, 10);
MOZ_ASSERT(!*end, "invalid parent PID");
nsCOMPtr<nsIFile> crashReportTmpDir;
if (XRE_GetProcessType() == GeckoProcessType_GPU) {
aArgc--;
if (strlen(aArgv[aArgc])) { // if it's empty, ignore it
nsresult rv = XRE_GetFileFromPath(aArgv[aArgc], getter_AddRefs(crashReportTmpDir));
if (NS_FAILED(rv)) {
// If we don't have a valid tmp dir we can probably still run ok, but
// crash report .extra files might not get picked up by the parent
// process. Debug-assert because this shouldn't happen in practice.
MOZ_ASSERT(false, "GPU process started without valid tmp dir!");
}
}
}
#ifdef XP_MACOSX
mozilla::ipc::SharedMemoryBasic::SetupMachMemory(parentPID, ports_in_receiver, ports_in_sender,
ports_out_sender, ports_out_receiver, true);
@ -676,7 +662,7 @@ XRE_InitChildProcess(int aArgc,
#ifdef MOZ_CRASHREPORTER
#if defined(XP_WIN) || defined(XP_MACOSX)
CrashReporter::InitChildProcessTmpDir(crashReportTmpDir);
CrashReporter::InitChildProcessTmpDir();
#endif
#endif