mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1446900: Place bug 1348361 (async content process launching) behind an ifdef and disable it to avoid numerous top crashers. r=jld
This commit is contained in:
parent
35a055854c
commit
4ecf5cdf16
@ -1519,6 +1519,10 @@ ContentParent::OnChannelConnected(int32_t pid)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#ifndef ASYNC_CONTENTPROC_LAUNCH
|
||||
SetOtherProcessId(pid);
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID) || defined(LINUX)
|
||||
// Check nice preference
|
||||
int32_t nice = Preferences::GetInt("dom.ipc.content.nice", 0);
|
||||
@ -1543,7 +1547,7 @@ ContentParent::OnChannelConnected(int32_t pid)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_CODE_COVERAGE
|
||||
#if defined(MOZ_CODE_COVERAGE) && defined(ASYNC_CONTENTPROC_LAUNCH)
|
||||
Unused << SendShareCodeCoverageMutex(
|
||||
CodeCoverageHandler::Get()->GetMutexHandle(pid));
|
||||
#endif
|
||||
@ -2059,13 +2063,27 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
|
||||
extraArgs.push_back(parentBuildID.get());
|
||||
|
||||
SetOtherProcessId(kInvalidProcessId, ProcessIdState::ePending);
|
||||
#ifdef ASYNC_CONTENTPROC_LAUNCH
|
||||
if (!mSubprocess->Launch(extraArgs)) {
|
||||
#else
|
||||
if (!mSubprocess->LaunchAndWaitForProcessHandle(extraArgs)) {
|
||||
#endif
|
||||
NS_ERROR("failed to launch child in the parent");
|
||||
MarkAsDead();
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ASYNC_CONTENTPROC_LAUNCH
|
||||
OpenWithAsyncPid(mSubprocess->GetChannel());
|
||||
#else
|
||||
base::ProcessId procId =
|
||||
base::GetProcId(mSubprocess->GetChildProcessHandle());
|
||||
Open(mSubprocess->GetChannel(), procId);
|
||||
#ifdef MOZ_CODE_COVERAGE
|
||||
Unused << SendShareCodeCoverageMutex(
|
||||
CodeCoverageHandler::Get()->GetMutexHandle(procId));
|
||||
#endif
|
||||
#endif // ASYNC_CONTENTPROC_LAUNCH
|
||||
|
||||
InitInternal(aInitialPriority);
|
||||
|
||||
@ -2076,8 +2094,9 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
|
||||
// Set a reply timeout for CPOWs.
|
||||
SetReplyTimeoutMs(Preferences::GetInt("dom.ipc.cpow.timeout", 0));
|
||||
|
||||
// TODO: If OtherPid() is not called between mSubprocess->Launch() and this,
|
||||
// then we're not really measuring how long it took to spawn the process.
|
||||
// TODO: In ASYNC_CONTENTPROC_LAUNCH, if OtherPid() is not called between
|
||||
// mSubprocess->Launch() and this, then we're not really measuring how long it
|
||||
// took to spawn the process.
|
||||
Telemetry::Accumulate(Telemetry::CONTENT_PROCESS_LAUNCH_TIME_MS,
|
||||
static_cast<uint32_t>((TimeStamp::Now() - mLaunchTS)
|
||||
.ToMilliseconds()));
|
||||
|
@ -555,13 +555,17 @@ GeckoChildProcessHost::RunPerformAsyncLaunch(std::vector<std::string> aExtraOpts
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mProcessState = PROCESS_ERROR;
|
||||
lock.Notify();
|
||||
#ifdef ASYNC_CONTENTPROC_LAUNCH
|
||||
OnProcessLaunchError();
|
||||
#endif
|
||||
CHROMIUM_LOG(ERROR) << "Failed to launch " <<
|
||||
XRE_ChildProcessTypeToString(mProcessType) << " subprocess";
|
||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_LAUNCH_FAILURE,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(mProcessType)));
|
||||
#ifdef ASYNC_CONTENTPROC_LAUNCH
|
||||
} else {
|
||||
OnProcessHandleReady(mChildProcessHandle);
|
||||
#endif
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user