diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp index 49c86aed16ad..8331098990b1 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp @@ -2520,7 +2520,7 @@ bool CanonicalBrowsingContext::AllowedInBFCache( return false; } - uint16_t bfcacheCombo = 0; + uint32_t bfcacheCombo = 0; if (mRestoreState) { bfcacheCombo |= BFCacheStatus::RESTORING; MOZ_LOG(gSHIPBFCacheLog, LogLevel::Debug, (" * during session restore")); @@ -2552,7 +2552,7 @@ bool CanonicalBrowsingContext::AllowedInBFCache( PreOrderWalk([&](BrowsingContext* aBrowsingContext) { WindowGlobalParent* wgp = aBrowsingContext->Canonical()->GetCurrentWindowGlobal(); - uint16_t subDocBFCacheCombo = wgp ? wgp->GetBFCacheStatus() : 0; + uint32_t subDocBFCacheCombo = wgp ? wgp->GetBFCacheStatus() : 0; if (wgp) { const Maybe& singleChannelId = wgp->GetSingleChannelId(); if (singleChannelId.isSome()) { diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 3d52a1e02efa..86256434c6ee 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -6768,7 +6768,7 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, // If the document does not want its presentation cached, then don't. RefPtr doc = mScriptGlobal->GetExtantDoc(); - uint16_t bfCacheCombo = 0; + uint32_t bfCacheCombo = 0; bool canSavePresentation = doc->CanSavePresentation(aNewRequest, bfCacheCombo, true); MOZ_ASSERT_IF(canSavePresentation, bfCacheCombo == 0); @@ -9376,7 +9376,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, // before calling Stop() below. if (mozilla::SessionHistoryInParent()) { Document* document = GetDocument(); - uint16_t flags = 0; + uint32_t flags = 0; if (document && !document->CanSavePresentation(nullptr, flags, true)) { // This forces some flags into the WindowGlobalParent's mBFCacheStatus, // which we'll then use in CanonicalBrowsingContext::AllowedInBFCache, diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index a1f670af4b71..15019745c65b 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -6930,7 +6930,7 @@ void Document::DeletePresShell() { mDesignModeSheetAdded = false; } -void Document::DisallowBFCaching(uint16_t aStatus) { +void Document::DisallowBFCaching(uint32_t aStatus) { NS_ASSERTION(!mBFCacheEntry, "We're already in the bfcache!"); if (!mBFCacheDisallowed) { WindowGlobalChild* wgc = GetWindowGlobalChild(); @@ -11009,7 +11009,7 @@ void Document::CollectDescendantDocuments( } bool Document::CanSavePresentation(nsIRequest* aNewRequest, - uint16_t& aBFCacheCombo, + uint32_t& aBFCacheCombo, bool aIncludeSubdocuments, bool aAllowUnloadListeners) { bool ret = true; @@ -11164,7 +11164,7 @@ bool Document::CanSavePresentation(nsIRequest* aNewRequest, auto entry = static_cast(iter.Get()); Document* subdoc = entry->mSubDocument; - uint16_t subDocBFCacheCombo = 0; + uint32_t subDocBFCacheCombo = 0; // The aIgnoreRequest we were passed is only for us, so don't pass it on. bool canCache = subdoc ? subdoc->CanSavePresentation(nullptr, subDocBFCacheCombo, diff --git a/dom/base/Document.h b/dom/base/Document.h index c31de1b99b26..e23b56886d0e 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -1198,7 +1198,7 @@ class Document : public nsINode, // Instead using this method, what you probably want is // RemoveFromBFCacheSync() as we do in MessagePort and BroadcastChannel. - void DisallowBFCaching(uint16_t aStatus = BFCacheStatus::NOT_ALLOWED); + void DisallowBFCaching(uint32_t aStatus = BFCacheStatus::NOT_ALLOWED); bool IsBFCachingAllowed() const { return !mBFCacheDisallowed; } @@ -2359,7 +2359,7 @@ class Document : public nsINode, * combination is when we try to BFCache aNewRequest */ virtual bool CanSavePresentation(nsIRequest* aNewRequest, - uint16_t& aBFCacheCombo, + uint32_t& aBFCacheCombo, bool aIncludeSubdocuments, bool aAllowUnloadListeners = true); diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index d2b47c5f9a3b..d22da676a6d0 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -4455,7 +4455,7 @@ mozilla::ipc::IPCResult ContentChild::RecvCanSavePresentation( bool canSave = true; // XXXBFCache pass the flags to telemetry. - uint16_t flags = 0; + uint32_t flags = 0; BrowsingContext* browsingContext = aTopLevelContext.get(); browsingContext->PreOrderWalk([&](BrowsingContext* aContext) { Document* doc = aContext->GetDocument(); diff --git a/dom/ipc/PWindowGlobal.ipdl b/dom/ipc/PWindowGlobal.ipdl index df071b5b6197..2e36ce93313e 100644 --- a/dom/ipc/PWindowGlobal.ipdl +++ b/dom/ipc/PWindowGlobal.ipdl @@ -188,7 +188,7 @@ parent: // Add the flags in aOnFlags to the current BFCache status and remove the // flags in aOffFlags from the current BFCache status. See the BFCacheStatus // enum for the valid flags. - async UpdateBFCacheStatus(uint16_t aOnFlags, uint16_t aOffFlags); + async UpdateBFCacheStatus(uint32_t aOnFlags, uint32_t aOffFlags); /** * Used to notify the parent when there's a change in the number of requests diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp index 3757eb161977..7cf58f285f97 100644 --- a/dom/ipc/WindowGlobalParent.cpp +++ b/dom/ipc/WindowGlobalParent.cpp @@ -1359,7 +1359,7 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvRequestRestoreTabContent() { return IPC_OK(); } -nsCString BFCacheStatusToString(uint16_t aFlags) { +nsCString BFCacheStatusToString(uint32_t aFlags) { if (aFlags == 0) { return "0"_ns; } @@ -1396,7 +1396,7 @@ nsCString BFCacheStatusToString(uint16_t aFlags) { } mozilla::ipc::IPCResult WindowGlobalParent::RecvUpdateBFCacheStatus( - const uint16_t& aOnFlags, const uint16_t& aOffFlags) { + const uint32_t& aOnFlags, const uint32_t& aOffFlags) { if (MOZ_UNLIKELY(MOZ_LOG_TEST(gSHIPBFCacheLog, LogLevel::Debug))) { nsAutoCString uri("[no uri]"); if (mDocumentURI) { diff --git a/dom/ipc/WindowGlobalParent.h b/dom/ipc/WindowGlobalParent.h index 04bf8b763816..0d6b26f2ea0f 100644 --- a/dom/ipc/WindowGlobalParent.h +++ b/dom/ipc/WindowGlobalParent.h @@ -222,7 +222,7 @@ class WindowGlobalParent final : public WindowContext, Maybe GetSingleChannelId() { return mSingleChannelId; } - uint16_t GetBFCacheStatus() { return mBFCacheStatus; } + uint32_t GetBFCacheStatus() { return mBFCacheStatus; } protected: already_AddRefed InitJSActor(JS::HandleObject aMaybeActor, @@ -292,8 +292,8 @@ class WindowGlobalParent final : public WindowContext, mozilla::ipc::IPCResult RecvResetSessionStore(uint32_t aEpoch); - mozilla::ipc::IPCResult RecvUpdateBFCacheStatus(const uint16_t& aOnFlags, - const uint16_t& aOffFlags); + mozilla::ipc::IPCResult RecvUpdateBFCacheStatus(const uint32_t& aOnFlags, + const uint32_t& aOffFlags); public: mozilla::ipc::IPCResult RecvSetSingleChannelId( @@ -385,7 +385,7 @@ class WindowGlobalParent final : public WindowContext, // subsequent ExpectPageUseCounters calls. bool mSentPageUseCounters = false; - uint16_t mBFCacheStatus = 0; + uint32_t mBFCacheStatus = 0; // mSingleChannelId records whether the loadgroup contains a single request // with an id. If there is one channel in the loadgroup and it has an id then