Bug 1548623 - Avoid performing recorded operations in the interrupt callback, r=smaug.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 02 May 2019 07:36:17 -1000
changeset 531260 da538647fa04239bac749064686e8971d22ff355
parent 531209 a722a039fb671037fa7570efb855c81ea9e3312e
child 531261 337d93c03c2e540b3f1d220f4ccbd1f9deb37435
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1548623
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548623 - Avoid performing recorded operations in the interrupt callback, r=smaug. Differential Revision: https://phabricator.services.mozilla.com/D29714
dom/ipc/ProcessHangMonitor.cpp
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -344,16 +344,23 @@ HangMonitorChild::~HangMonitorChild() {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(sInstance == this);
   sInstance = nullptr;
 }
 
 void HangMonitorChild::InterruptCallback() {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
+  // The interrupt callback is triggered at non-deterministic points when
+  // recording/replaying, so don't perform any operations that can interact
+  // with the recording.
+  if (recordreplay::IsRecordingOrReplaying()) {
+    return;
+  }
+
   bool paintWhileInterruptingJS;
   bool paintWhileInterruptingJSForce;
   TabId paintWhileInterruptingJSTab;
   LayersObserverEpoch paintWhileInterruptingJSEpoch;
 
   bool cancelContentJS;
   TabId cancelContentJSTab;
   nsIRemoteTab::NavigationType cancelContentJSNavigationType;
@@ -374,19 +381,17 @@ void HangMonitorChild::InterruptCallback
     cancelContentJSNavigationIndex = mCancelContentJSNavigationIndex;
     cancelContentJSNavigationURI = std::move(mCancelContentJSNavigationURI);
     cancelContentJSEpoch = mCancelContentJSEpoch;
 
     mPaintWhileInterruptingJS = false;
     mCancelContentJS = false;
   }
 
-  // Don't paint from the interrupt callback when recording or replaying, as
-  // the interrupt callback is triggered non-deterministically.
-  if (paintWhileInterruptingJS && !recordreplay::IsRecordingOrReplaying()) {
+  if (paintWhileInterruptingJS) {
     RefPtr<BrowserChild> browserChild =
         BrowserChild::FindBrowserChild(paintWhileInterruptingJSTab);
     if (browserChild) {
       js::AutoAssertNoContentJS nojs(mContext);
       browserChild->PaintWhileInterruptingJS(paintWhileInterruptingJSEpoch,
                                              paintWhileInterruptingJSForce);
     }
   }