Bug 1548623 - Avoid performing recorded operations in the interrupt callback, r=smaug.

Differential Revision: https://phabricator.services.mozilla.com/D29714

--HG--
extra : rebase_source : e94e928e43c64a3f313217855444dcd8dc7938fe
This commit is contained in:
Brian Hackett 2019-05-02 07:36:17 -10:00
parent 265d1c1b45
commit d061f61772

View File

@ -349,6 +349,13 @@ HangMonitorChild::~HangMonitorChild() {
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;
@ -379,9 +386,7 @@ void HangMonitorChild::InterruptCallback() {
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) {