Skip to content

Commit

Permalink
Bug 977359 Part 3: Remove runtime checks for Nuwa deadlock in debug b…
Browse files Browse the repository at this point in the history
…uild. r=khuey
  • Loading branch information
Cervantes Yu committed Apr 15, 2014
1 parent 4c0a851 commit 8d94b01
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions dom/ipc/PreallocatedProcessManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class PreallocatedProcessManagerImpl MOZ_FINAL
void RunAfterPreallocatedProcessReady(nsIRunnable* aRunnable);

private:
void OnNuwaForkTimeout();
void NuwaFork();

// initialization off the critical path of app startup.
Expand All @@ -69,7 +68,6 @@ class PreallocatedProcessManagerImpl MOZ_FINAL
// 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;

Expand Down Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8d94b01

Please sign in to comment.