Skip to content

Commit

Permalink
Assert this in nsDocShell::ActivenessMaybeChanged.
Browse files Browse the repository at this point in the history
Addresses #748
  • Loading branch information
kannanvijayan committed Mar 23, 2022
1 parent 03edf7c commit 0d32fcf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docshell/base/nsDocShell.cpp
Expand Up @@ -32,6 +32,7 @@
#include "mozilla/ObservedDocShell.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/RecordReplay.h"
#include "mozilla/ResultExtensions.h"
#include "mozilla/SchedulerGroup.h"
#include "mozilla/ScopeExit.h"
Expand Down Expand Up @@ -392,6 +393,7 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
mForcedAutodetection(false),
mNeedToReportActiveAfterLoadingBecomesActive(false) {
// If no outer window ID was provided, generate a new one.
recordreplay::RegisterThing(this);
if (aContentWindowID == 0) {
mContentWindowID = nsContentUtils::GenerateWindowId();
}
Expand Down Expand Up @@ -445,6 +447,7 @@ nsDocShell::~nsDocShell() {
(void*)this, gNumberOfDocShells, getpid(), mDocShellID, url.get()));
}
#endif
recordreplay::UnregisterThing(this);
}

bool nsDocShell::Initialize() {
Expand Down Expand Up @@ -4723,6 +4726,11 @@ nsDocShell::GetVisibility(bool* aVisibility) {
}

void nsDocShell::ActivenessMaybeChanged() {
// Assert the same-ness of the docshell on record and replay.
// https://github.com/RecordReplay/gecko-dev/issues/748
recordreplay::RecordReplayAssert("nsDocShell(%u)::ActivenessMaybeChanged()",
(unsigned) recordreplay::ThingIndex(this));

const bool isActive = mBrowsingContext->IsActive();
if (RefPtr<PresShell> presShell = GetPresShell()) {
presShell->ActivenessMaybeChanged();
Expand Down

0 comments on commit 0d32fcf

Please sign in to comment.