Bug 977359 - Part 3: Remove runtime checks for Nuwa deadlock in debug build. r=khuey, a=1.3+
authorCervantes Yu <cyu@mozilla.com>
Tue, 15 Apr 2014 21:27:56 +0800
changeset 192000 a45a0dd354311348c19c24e33ef37604220925d6
parent 191999 d7dcfb87cbd9da45cf1787c1227627b88686d72d
child 192001 c9b44c1814cffb1ef5b9ebd978390567260a29a2
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, 1
bugs977359
milestone30.0a2
Bug 977359 - Part 3: Remove runtime checks for Nuwa deadlock in debug build. r=khuey, a=1.3+
dom/ipc/PreallocatedProcessManager.cpp
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -55,26 +55,24 @@ public:
   void PublishSpareProcess(ContentParent* aContent);
   void MaybeForgetSpare(ContentParent* aContent);
   void OnNuwaReady();
   bool PreallocatedProcessReady();
   already_AddRefed<ContentParent> GetSpareProcess();
   void RunAfterPreallocatedProcessReady(nsIRunnable* aRunnable);
 
 private:
-  void OnNuwaForkTimeout();
   void NuwaFork();
 
   // initialization off the critical path of app startup.
   CancelableTask* mPreallocateAppProcessTask;
 
   // 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;
 
   // Nuwa process is ready for creating new process.
   bool mIsNuwaReady;
 #endif
 
 private:
@@ -307,21 +305,16 @@ PreallocatedProcessManagerImpl::PublishS
     AutoJSContext cx;
     nsCOMPtr<nsIMessageBroadcaster> ppmm =
       do_GetService("@mozilla.org/parentprocessmessagemanager;1");
     nsresult rv = ppmm->BroadcastAsyncMessage(
       NS_LITERAL_STRING("TEST-ONLY:nuwa-add-new-process"),
       JS::NullHandleValue, JS::NullHandleValue, cx, 1);
   }
 
-  if (!mNuwaForkWaitTasks.IsEmpty()) {
-    mNuwaForkWaitTasks.ElementAt(0)->Cancel();
-    mNuwaForkWaitTasks.RemoveElementAt(0);
-  }
-
   mSpareProcesses.AppendElement(aContent);
 
   if (!mDelayedContentParentRequests.IsEmpty()) {
     nsCOMPtr<nsIRunnable> runnable = mDelayedContentParentRequests[0];
     mDelayedContentParentRequests.RemoveElementAt(0);
     NS_DispatchToMainThread(runnable);
   }
 }
@@ -370,37 +363,18 @@ PreallocatedProcessManagerImpl::OnNuwaRe
 bool
 PreallocatedProcessManagerImpl::PreallocatedProcessReady()
 {
   return !mSpareProcesses.IsEmpty();
 }
 
 
 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
 
 void
 PreallocatedProcessManagerImpl::Disable()
 {
   if (!mEnabled) {