Bug 977359 Part 3: Remove runtime checks for Nuwa deadlock in debug build. r=khuey

This commit is contained in:
Cervantes Yu 2014-04-15 21:27:56 +08:00
Родитель 878e346c04
Коммит 08f2bbefda
1 изменённых файлов: 0 добавлений и 26 удалений

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

@ -60,7 +60,6 @@ public:
void RunAfterPreallocatedProcessReady(nsIRunnable* aRunnable);
private:
void OnNuwaForkTimeout();
void NuwaFork();
// initialization off the critical path of app startup.
@ -69,7 +68,6 @@ private:
// The array containing the preallocated processes. 4 as the inline storage size
// should be enough so we don't need to grow the nsAutoTArray.
nsAutoTArray<nsRefPtr<ContentParent>, 4> mSpareProcesses;
nsTArray<CancelableTask*> mNuwaForkWaitTasks;
nsTArray<nsCOMPtr<nsIRunnable> > mDelayedContentParentRequests;
@ -312,11 +310,6 @@ PreallocatedProcessManagerImpl::PublishSpareProcess(ContentParent* aContent)
JS::NullHandleValue, JS::NullHandleValue, cx, 1);
}
if (!mNuwaForkWaitTasks.IsEmpty()) {
mNuwaForkWaitTasks.ElementAt(0)->Cancel();
mNuwaForkWaitTasks.RemoveElementAt(0);
}
mSpareProcesses.AppendElement(aContent);
if (!mDelayedContentParentRequests.IsEmpty()) {
@ -374,28 +367,9 @@ PreallocatedProcessManagerImpl::PreallocatedProcessReady()
}
void
PreallocatedProcessManagerImpl::OnNuwaForkTimeout()
{
if (!mNuwaForkWaitTasks.IsEmpty()) {
mNuwaForkWaitTasks.RemoveElementAt(0);
}
// We haven't RecvAddNewProcess() after NuwaFork(). Maybe the main
// thread of the Nuwa process is in deadlock.
MOZ_ASSERT(false, "Can't fork from the nuwa process.");
}
void
PreallocatedProcessManagerImpl::NuwaFork()
{
CancelableTask* nuwaForkTimeoutTask = NewRunnableMethod(
this, &PreallocatedProcessManagerImpl::OnNuwaForkTimeout);
mNuwaForkWaitTasks.AppendElement(nuwaForkTimeoutTask);
MessageLoop::current()->PostDelayedTask(FROM_HERE,
nuwaForkTimeoutTask,
NUWA_FORK_WAIT_DURATION_MS);
mPreallocatedAppProcess->SendNuwaFork();
}
#endif