Bug 1506007 - Don't create checkpoints while painting with AutoAssertNoContentJS on the stack, r=mstange.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 08 Nov 2018 17:32:20 -1000
changeset 446721 bc6ffce8b9b68f5a114dd1f11d4fe9a8efff15d1
parent 446720 b5ebe325c20d5e747953a9cec13e00d1e81fa79c
child 446722 a424be1d8a667c799cbe4f337626591b1087f14d
push id35047
push userbtara@mozilla.com
push dateFri, 16 Nov 2018 09:48:23 +0000
treeherdermozilla-central@4d6d3403eb6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1506007
milestone65.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 1506007 - Don't create checkpoints while painting with AutoAssertNoContentJS on the stack, r=mstange.
layout/base/PresShell.cpp
toolkit/recordreplay/ipc/ChildIPC.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6398,16 +6398,24 @@ PresShell::Paint(nsView*         aViewTo
     flags |= PaintFrameFlags::PAINT_COMPRESSED;
     mNextPaintCompressed = false;
   }
 
   if (frame) {
     // We can paint directly into the widget using its layer manager.
     nsLayoutUtils::PaintFrame(nullptr, frame, aDirtyRegion, bgcolor,
                               nsDisplayListBuilderMode::PAINTING, flags);
+
+    // When recording/replaying, create a checkpoint after every paint. This
+    // can cause content JS to run, so reset |nojs|.
+    if (recordreplay::IsRecordingOrReplaying()) {
+      nojs.reset();
+      recordreplay::child::CreateCheckpoint();
+    }
+
     return;
   }
 
   if (layerManager->GetBackendType() == layers::LayersBackend::LAYERS_WR) {
     nsPresContext* pc = GetPresContext();
     LayoutDeviceRect bounds =
       LayoutDeviceRect::FromAppUnits(pc->GetVisibleArea(), pc->AppUnitsPerDevPixel());
     bgcolor = NS_ComposeColors(bgcolor, mCanvasBackgroundColor);
--- a/toolkit/recordreplay/ipc/ChildIPC.cpp
+++ b/toolkit/recordreplay/ipc/ChildIPC.cpp
@@ -531,18 +531,16 @@ NotifyPaintStart()
     // Repaint failures are not allowed in the repaint stress mode.
     gAllowRepaintFailures =
       Preferences::GetBool("devtools.recordreplay.allowRepaintFailures") &&
       !parent::InRepaintStressMode();
   }
 
   gNumPendingPaints++;
   gNumPendingMainThreadPaints++;
-
-  CreateCheckpoint();
 }
 
 static void
 PaintFromMainThread()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   gNumPendingMainThreadPaints--;