Bug 1452766 - Temporarily disable ForcePaint BHR r=mconley
authorDoug Thayer <dothayer@mozilla.com>
Mon, 09 Apr 2018 13:24:46 -0700
changeset 779673 45e8d02f4ba421f2651be3e21812d7cd12cca4bb
parent 779672 c99761c348111e05e49c33ff2513e3d46d0db9fe
child 779674 10477098a16512a291b7e551de603435a62ef879
push id105836
push userbmo:ato@sny.no
push dateTue, 10 Apr 2018 12:07:22 +0000
reviewersmconley
bugs1452766
milestone61.0a1
Bug 1452766 - Temporarily disable ForcePaint BHR r=mconley MozReview-Commit-ID: FhilA7sRq2T
dom/ipc/ProcessHangMonitor.cpp
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -430,67 +430,46 @@ HangMonitorChild::RecvEndStartingDebugge
 
 mozilla::ipc::IPCResult
 HangMonitorChild::RecvForcePaint(const TabId& aTabId, const uint64_t& aLayerObserverEpoch)
 {
   MOZ_RELEASE_ASSERT(IsOnThread());
 
   {
     MonitorAutoLock lock(mMonitor);
-    // If we lose our race, and the main thread has already painted,
-    // the NotifyActivity call below would result in an indefinite
-    // hang, since it wouldn't have a matching NotifyWait()
-    if (mForcePaintEpoch >= aLayerObserverEpoch) {
-      return IPC_OK();
-    }
     MaybeStartForcePaint();
     mForcePaint = true;
     mForcePaintTab = aTabId;
     mForcePaintEpoch = aLayerObserverEpoch;
   }
 
   JS_RequestInterruptCallback(mContext);
 
   return IPC_OK();
 }
 
 void
 HangMonitorChild::MaybeStartForcePaint()
 {
+  // See Bug 1449662. The body of this function other than assertions
+  // has been temporarily removed to diagnose a tab switch spinner
+  // problem.
   if (!NS_IsMainThread()) {
     mMonitor.AssertCurrentThreadOwns();
   }
-
-  if (!mBHRMonitorActive.exchange(true)) {
-    mForcePaintMonitor->NotifyActivity();
-  }
 }
 
 void
 HangMonitorChild::ClearForcePaint(uint64_t aLayerObserverEpoch)
 {
+  // See Bug 1449662. The body of this function other than assertions
+  // has been temporarily removed to diagnose a tab switch spinner
+  // problem.
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   MOZ_RELEASE_ASSERT(XRE_IsContentProcess());
-
-  {
-    MonitorAutoLock lock(mMonitor);
-    // Set the epoch, so that if the forcepaint loses its race, it
-    // knows it and can exit appropriately. However, ensure we don't
-    // overwrite an even newer mForcePaintEpoch which could have
-    // come in in a ForcePaint notification while we were painting.
-    if (aLayerObserverEpoch > mForcePaintEpoch) {
-      mForcePaintEpoch = aLayerObserverEpoch;
-    }
-    mForcePaintMonitor->NotifyWait();
-
-    // ClearForcePaint must be called on the main thread, and the
-    // hang monitor thread only sets this with mMonitor held, so there
-    // should be no risk of missing NotifyActivity calls here.
-    mBHRMonitorActive = false;
-  }
 }
 
 void
 HangMonitorChild::Bind(Endpoint<PProcessHangMonitorChild>&& aEndpoint)
 {
   MOZ_RELEASE_ASSERT(IsOnThread());
 
   MOZ_ASSERT(!sInstance);