Bug 1452766 - Temporarily disable ForcePaint BHR r?mconley draft
authorDoug Thayer <dothayer@mozilla.com>
Mon, 09 Apr 2018 13:24:46 -0700
changeset 779385 53207877846178db15a974474d9392b046f3fd2b
parent 777562 071ee904485e21e19ca08456d32bce6825b77a26
push id105762
push userbmo:dothayer@mozilla.com
push dateMon, 09 Apr 2018 20:27:18 +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);