Skip to content

Commit 8b8ebf1

Browse files
authoredMar 9, 2023
Use RecordReplayAllowSideEffects API (#962)
1 parent f9c9e57 commit 8b8ebf1

9 files changed

+13
-13
lines changed
 

‎dom/base/Document.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10547,7 +10547,7 @@ class nsDocumentOnStack {
1054710547

1054810548
void Document::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
1054910549
// See PresShell::DoFlushPendingNotifications.
10550-
if (!mozilla::recordreplay::IsUnhandledDivergenceAllowed()) {
10550+
if (!mozilla::recordreplay::AllowSideEffects()) {
1055110551
return;
1055210552
}
1055310553

‎dom/canvas/CanvasRenderingContext2D.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4068,7 +4068,7 @@ gfxFontGroup* CanvasRenderingContext2D::GetCurrentFontStyle() {
40684068
// Creating new font groups interacts with the system and could trigger
40694069
// unhandled divergences from the recording, so avoid this when those
40704070
// divergences aren't allowed.
4071-
if (!recordreplay::IsUnhandledDivergenceAllowed()) {
4071+
if (!recordreplay::AllowSideEffects()) {
40724072
return nullptr;
40734073
}
40744074

‎layout/base/PresShell.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4062,7 +4062,7 @@ static inline void AssertFrameTreeIsSane(const PresShell& aPresShell) {
40624062
void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
40634063
// Flushing layout can interact with the system in new ways, and doesn't
40644064
// happen when unhandled divergence isn't allowed.
4065-
if (!mozilla::recordreplay::IsUnhandledDivergenceAllowed()) {
4065+
if (!mozilla::recordreplay::AllowSideEffects()) {
40664066
return;
40674067
}
40684068

‎layout/generic/nsBlockFrame.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ static bool IsLineClampItem(const ReflowInput& aReflowInput) {
12281228
void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
12291229
const ReflowInput& aReflowInput,
12301230
nsReflowStatus& aStatus) {
1231-
MOZ_RELEASE_ASSERT(mozilla::recordreplay::IsUnhandledDivergenceAllowed());
1231+
MOZ_RELEASE_ASSERT(mozilla::recordreplay::AllowSideEffects());
12321232

12331233
MarkInReflow();
12341234
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame");

‎layout/generic/nsGfxScrollFrame.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ bool nsHTMLScrollFrame::InInitialReflow() const {
875875

876876
void nsHTMLScrollFrame::ReflowContents(ScrollReflowInput* aState,
877877
const ReflowOutput& aDesiredSize) {
878-
MOZ_RELEASE_ASSERT(mozilla::recordreplay::IsUnhandledDivergenceAllowed());
878+
MOZ_RELEASE_ASSERT(mozilla::recordreplay::AllowSideEffects());
879879

880880
ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode());
881881
ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState),

‎layout/generic/nsTextFrame.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ void BuildTextRunsScanner::FlushFrames(bool aFlushLineBreaks,
16241624
bool aSuppressTrailingBreak) {
16251625
// For now we avoid flushing layout state after diverging from the recording,
16261626
// so we don't encounter new calls into the system.
1627-
if (!recordreplay::IsUnhandledDivergenceAllowed()) {
1627+
if (!recordreplay::AllowSideEffects()) {
16281628
return;
16291629
}
16301630

‎mfbt/RecordReplay.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace recordreplay {
3131
Macro(InternalRecordReplayValue, size_t, (const char* aWhy, size_t aValue), \
3232
(aWhy, aValue)) \
3333
Macro(InternalHasDivergedFromRecording, bool, (), ()) \
34-
Macro(InternalIsUnhandledDivergenceAllowed, bool, (), ()) \
34+
Macro(InternalAllowSideEffects, bool, (), ()) \
3535
Macro(InternalThingIndex, size_t, (void* aThing), (aThing)) \
3636
Macro(InternalIndexThing, void*, (size_t aId), (aId)) \
3737
Macro(InternalCreateOrderedLock, int, (const char* aName), (aName)) \

‎mfbt/RecordReplay.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static inline bool HasDivergedFromRecording();
151151
// Return whether execution is allowed to interact with the system in a way
152152
// that could trigger an unhandled divergence. This returns true except during
153153
// certain operations while diverged from the recording.
154-
static inline bool IsUnhandledDivergenceAllowed();
154+
static inline bool AllowSideEffects();
155155

156156
// API for debugging inconsistent behavior between recording and replay.
157157
// By calling Assert or AssertBytes a thread event will be inserted and any
@@ -418,7 +418,7 @@ MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(RecordReplayBytes,
418418
(const char* aWhy, void* aData, size_t aSize),
419419
(aWhy, aData, aSize))
420420
MOZ_MAKE_RECORD_REPLAY_WRAPPER(HasDivergedFromRecording, bool, false, (), ())
421-
MOZ_MAKE_RECORD_REPLAY_WRAPPER(IsUnhandledDivergenceAllowed, bool, true, (), ())
421+
MOZ_MAKE_RECORD_REPLAY_WRAPPER(AllowSideEffects, bool, true, (), ())
422422
MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(InvalidateRecording, (const char* aWhy),
423423
(aWhy))
424424
MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(RecordReplayAssertBytes,

‎toolkit/recordreplay/ProcessRecordReplay.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void (*gBeginDisallowEvents)();
107107
static void (*gEndDisallowEvents)();
108108
static bool (*gAreEventsDisallowed)();
109109
static bool (*gHasDivergedFromRecording)();
110-
static bool (*gIsUnhandledDivergenceAllowed)();
110+
static bool (*gAllowSideEffects)();
111111
static void (*gRecordReplayNewCheckpoint)();
112112
static bool (*gRecordReplayIsReplaying)();
113113
static int (*gCreateOrderedLock)(const char* aName);
@@ -433,7 +433,7 @@ MOZ_EXPORT void RecordReplayInterface_Initialize(int* aArgc, char*** aArgv) {
433433
LoadSymbol("RecordReplayEndDisallowEvents", gEndDisallowEvents);
434434
LoadSymbol("RecordReplayAreEventsDisallowed", gAreEventsDisallowed);
435435
LoadSymbol("RecordReplayHasDivergedFromRecording", gHasDivergedFromRecording);
436-
LoadSymbol("RecordReplayIsUnhandledDivergenceAllowed", gIsUnhandledDivergenceAllowed);
436+
LoadSymbol("RecordReplayAllowSideEffects", gAllowSideEffects);
437437
LoadSymbol("RecordReplayNewCheckpoint", gRecordReplayNewCheckpoint);
438438
LoadSymbol("RecordReplayIsReplaying", gRecordReplayIsReplaying);
439439
LoadSymbol("RecordReplayCreateOrderedLock", gCreateOrderedLock);
@@ -665,8 +665,8 @@ MOZ_EXPORT bool RecordReplayInterface_InternalHasDivergedFromRecording() {
665665
return gHasDivergedFromRecording();
666666
}
667667

668-
MOZ_EXPORT bool RecordReplayInterface_InternalIsUnhandledDivergenceAllowed() {
669-
return gIsUnhandledDivergenceAllowed();
668+
MOZ_EXPORT bool RecordReplayInterface_InternalAllowSideEffects() {
669+
return gAllowSideEffects();
670670
}
671671

672672
MOZ_EXPORT int RecordReplayInterface_InternalCreateOrderedLock(const char* aName) {

0 commit comments

Comments
 (0)
Please sign in to comment.