Bug 1839316: part 5) Guard the "fetchpriority" attribute behind a pref. r=kershaw...
[gecko.git] / docshell / base / CanonicalBrowsingContext.h
blob3bf1db6cb2b626c6fc3189433e1077179090864c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_CanonicalBrowsingContext_h
8 #define mozilla_dom_CanonicalBrowsingContext_h
10 #include "mozilla/dom/BrowsingContext.h"
11 #include "mozilla/dom/MediaControlKeySource.h"
12 #include "mozilla/dom/BrowsingContextWebProgress.h"
13 #include "mozilla/dom/ProcessIsolation.h"
14 #include "mozilla/dom/Promise.h"
15 #include "mozilla/dom/SessionHistoryEntry.h"
16 #include "mozilla/dom/SessionStoreRestoreData.h"
17 #include "mozilla/dom/SessionStoreUtils.h"
18 #include "mozilla/dom/ipc/IdType.h"
19 #include "mozilla/RefPtr.h"
20 #include "mozilla/MozPromise.h"
21 #include "nsCycleCollectionParticipant.h"
22 #include "nsWrapperCache.h"
23 #include "nsTArray.h"
24 #include "nsTHashtable.h"
25 #include "nsHashKeys.h"
26 #include "nsISecureBrowserUI.h"
28 class nsIBrowserDOMWindow;
29 class nsISHistory;
30 class nsIWidget;
31 class nsIPrintSettings;
32 class nsSHistory;
33 class nsBrowserStatusFilter;
34 class nsSecureBrowserUI;
35 class CallerWillNotifyHistoryIndexAndLengthChanges;
36 class nsITimer;
38 namespace mozilla {
39 enum class CallState;
40 class BounceTrackingState;
42 namespace embedding {
43 class PrintData;
46 namespace net {
47 class DocumentLoadListener;
50 namespace dom {
52 class BrowserParent;
53 class BrowserBridgeParent;
54 class FeaturePolicy;
55 struct LoadURIOptions;
56 class MediaController;
57 struct LoadingSessionHistoryInfo;
58 class SSCacheCopy;
59 class WindowGlobalParent;
60 class SessionStoreFormData;
61 class SessionStoreScrollData;
63 // CanonicalBrowsingContext is a BrowsingContext living in the parent
64 // process, with whatever extra data that a BrowsingContext in the
65 // parent needs.
66 class CanonicalBrowsingContext final : public BrowsingContext {
67 public:
68 NS_DECL_ISUPPORTS_INHERITED
69 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
70 CanonicalBrowsingContext, BrowsingContext)
72 static already_AddRefed<CanonicalBrowsingContext> Get(uint64_t aId);
73 static CanonicalBrowsingContext* Cast(BrowsingContext* aContext);
74 static const CanonicalBrowsingContext* Cast(const BrowsingContext* aContext);
75 static already_AddRefed<CanonicalBrowsingContext> Cast(
76 already_AddRefed<BrowsingContext>&& aContext);
78 bool IsOwnedByProcess(uint64_t aProcessId) const {
79 return mProcessId == aProcessId;
81 bool IsEmbeddedInProcess(uint64_t aProcessId) const {
82 return mEmbedderProcessId == aProcessId;
84 uint64_t OwnerProcessId() const { return mProcessId; }
85 uint64_t EmbedderProcessId() const { return mEmbedderProcessId; }
86 ContentParent* GetContentParent() const;
88 void GetCurrentRemoteType(nsACString& aRemoteType, ErrorResult& aRv) const;
90 void SetOwnerProcessId(uint64_t aProcessId);
92 // The ID of the BrowsingContext which caused this BrowsingContext to be
93 // opened, or `0` if this is unknown.
94 // Only set for toplevel content BrowsingContexts, and may be from a different
95 // BrowsingContextGroup.
96 uint64_t GetCrossGroupOpenerId() const { return mCrossGroupOpenerId; }
97 void SetCrossGroupOpenerId(uint64_t aOpenerId);
98 void SetCrossGroupOpener(CanonicalBrowsingContext& aCrossGroupOpener,
99 ErrorResult& aRv);
101 void GetWindowGlobals(nsTArray<RefPtr<WindowGlobalParent>>& aWindows);
103 // The current active WindowGlobal.
104 WindowGlobalParent* GetCurrentWindowGlobal() const;
106 // Same as the methods on `BrowsingContext`, but with the types already cast
107 // to the parent process type.
108 CanonicalBrowsingContext* GetParent() {
109 return Cast(BrowsingContext::GetParent());
111 CanonicalBrowsingContext* Top() { return Cast(BrowsingContext::Top()); }
112 WindowGlobalParent* GetParentWindowContext();
113 WindowGlobalParent* GetTopWindowContext();
115 already_AddRefed<nsIWidget> GetParentProcessWidgetContaining();
116 already_AddRefed<nsIBrowserDOMWindow> GetBrowserDOMWindow();
118 // Same as `GetParentWindowContext`, but will also cross <browser> and
119 // content/chrome boundaries.
120 already_AddRefed<WindowGlobalParent> GetEmbedderWindowGlobal() const;
122 already_AddRefed<CanonicalBrowsingContext> GetParentCrossChromeBoundary();
124 already_AddRefed<CanonicalBrowsingContext> TopCrossChromeBoundary();
125 Nullable<WindowProxyHolder> GetTopChromeWindow();
127 nsISHistory* GetSessionHistory();
128 SessionHistoryEntry* GetActiveSessionHistoryEntry();
129 void SetActiveSessionHistoryEntry(SessionHistoryEntry* aEntry);
131 UniquePtr<LoadingSessionHistoryInfo> CreateLoadingSessionHistoryEntryForLoad(
132 nsDocShellLoadState* aLoadState, SessionHistoryEntry* aExistingEntry,
133 nsIChannel* aChannel);
135 UniquePtr<LoadingSessionHistoryInfo> ReplaceLoadingSessionHistoryEntryForLoad(
136 LoadingSessionHistoryInfo* aInfo, nsIChannel* aNewChannel);
138 using PrintPromise = MozPromise</* unused */ bool, nsresult, false>;
139 MOZ_CAN_RUN_SCRIPT RefPtr<PrintPromise> Print(nsIPrintSettings*);
140 MOZ_CAN_RUN_SCRIPT already_AddRefed<Promise> PrintJS(nsIPrintSettings*,
141 ErrorResult&);
143 // Call the given callback on all top-level descendant BrowsingContexts.
144 // Return Callstate::Stop from the callback to stop calling
145 // further children.
146 void CallOnAllTopDescendants(
147 const std::function<mozilla::CallState(CanonicalBrowsingContext*)>&
148 aCallback);
150 void SessionHistoryCommit(uint64_t aLoadId, const nsID& aChangeID,
151 uint32_t aLoadType, bool aPersist,
152 bool aCloneEntryChildren, bool aChannelExpired,
153 uint32_t aCacheKey);
155 // Calls the session history listeners' OnHistoryReload, storing the result in
156 // aCanReload. If aCanReload is set to true and we have an active or a loading
157 // entry then aLoadState will be initialized from that entry, and
158 // aReloadActiveEntry will be true if we have an active entry. If aCanReload
159 // is true and aLoadState and aReloadActiveEntry are not set then we should
160 // attempt to reload based on the current document in the docshell.
161 void NotifyOnHistoryReload(
162 bool aForceReload, bool& aCanReload,
163 Maybe<NotNull<RefPtr<nsDocShellLoadState>>>& aLoadState,
164 Maybe<bool>& aReloadActiveEntry);
166 // See BrowsingContext::SetActiveSessionHistoryEntry.
167 void SetActiveSessionHistoryEntry(const Maybe<nsPoint>& aPreviousScrollPos,
168 SessionHistoryInfo* aInfo,
169 uint32_t aLoadType,
170 uint32_t aUpdatedCacheKey,
171 const nsID& aChangeID);
173 void ReplaceActiveSessionHistoryEntry(SessionHistoryInfo* aInfo);
175 void RemoveDynEntriesFromActiveSessionHistoryEntry();
177 void RemoveFromSessionHistory(const nsID& aChangeID);
179 Maybe<int32_t> HistoryGo(int32_t aOffset, uint64_t aHistoryEpoch,
180 bool aRequireUserInteraction, bool aUserActivation,
181 Maybe<ContentParentId> aContentId);
183 JSObject* WrapObject(JSContext* aCx,
184 JS::Handle<JSObject*> aGivenProto) override;
186 // Dispatches a wheel zoom change to the embedder element.
187 void DispatchWheelZoomChange(bool aIncrease);
189 // This function is used to start the autoplay media which are delayed to
190 // start. If needed, it would also notify the content browsing context which
191 // are related with the canonical browsing content tree to start delayed
192 // autoplay media.
193 void NotifyStartDelayedAutoplayMedia();
195 // This function is used to mute or unmute all media within a tab. It would
196 // set the media mute property for the top level window and propagate it to
197 // other top level windows in other processes.
198 void NotifyMediaMutedChanged(bool aMuted, ErrorResult& aRv);
200 // Return the number of unique site origins by iterating all given BCs,
201 // including their subtrees.
202 static uint32_t CountSiteOrigins(
203 GlobalObject& aGlobal,
204 const Sequence<mozilla::OwningNonNull<BrowsingContext>>& aRoots);
206 // Return true if a private browsing session is active.
207 static bool IsPrivateBrowsingActive();
209 // This function would propogate the action to its all child browsing contexts
210 // in content processes.
211 void UpdateMediaControlAction(const MediaControlAction& aAction);
213 // Triggers a load in the process
214 using BrowsingContext::LoadURI;
215 void FixupAndLoadURIString(const nsAString& aURI,
216 const LoadURIOptions& aOptions,
217 ErrorResult& aError);
218 void LoadURI(nsIURI* aURI, const LoadURIOptions& aOptions,
219 ErrorResult& aError);
221 void GoBack(const Optional<int32_t>& aCancelContentJSEpoch,
222 bool aRequireUserInteraction, bool aUserActivation);
223 void GoForward(const Optional<int32_t>& aCancelContentJSEpoch,
224 bool aRequireUserInteraction, bool aUserActivation);
225 void GoToIndex(int32_t aIndex, const Optional<int32_t>& aCancelContentJSEpoch,
226 bool aUserActivation);
227 void Reload(uint32_t aReloadFlags);
228 void Stop(uint32_t aStopFlags);
230 // Get the publicly exposed current URI loaded in this BrowsingContext.
231 already_AddRefed<nsIURI> GetCurrentURI() const;
232 void SetCurrentRemoteURI(nsIURI* aCurrentRemoteURI);
234 BrowserParent* GetBrowserParent() const;
235 void SetCurrentBrowserParent(BrowserParent* aBrowserParent);
237 // Internal method to change which process a BrowsingContext is being loaded
238 // in. The returned promise will resolve when the process switch is completed.
240 // A NOT_REMOTE_TYPE aRemoteType argument will perform a process switch into
241 // the parent process, and the method will resolve with a null BrowserParent.
242 using RemotenessPromise = MozPromise<RefPtr<BrowserParent>, nsresult, false>;
243 RefPtr<RemotenessPromise> ChangeRemoteness(
244 const NavigationIsolationOptions& aOptions, uint64_t aPendingSwitchId);
246 // Return a media controller from the top-level browsing context that can
247 // control all media belonging to this browsing context tree. Return nullptr
248 // if the top-level browsing context has been discarded.
249 MediaController* GetMediaController();
250 bool HasCreatedMediaController() const;
252 // Attempts to start loading the given load state in this BrowsingContext,
253 // without requiring any communication from a docshell. This will handle
254 // computing the right process to load in, and organising handoff to
255 // the right docshell when we get a response.
256 bool LoadInParent(nsDocShellLoadState* aLoadState, bool aSetNavigating);
258 // Attempts to start loading the given load state in this BrowsingContext,
259 // in parallel with a DocumentChannelChild being created in the docshell.
260 // Requires the DocumentChannel to connect with this load for it to
261 // complete successfully.
262 bool AttemptSpeculativeLoadInParent(nsDocShellLoadState* aLoadState);
264 // Get or create a secure browser UI for this BrowsingContext
265 nsISecureBrowserUI* GetSecureBrowserUI();
267 BrowsingContextWebProgress* GetWebProgress() { return mWebProgress; }
269 // Called when the current URI changes (from an
270 // nsIWebProgressListener::OnLocationChange event, so that we
271 // can update our security UI for the new location, or when the
272 // mixed content/https-only state for our current window is changed.
273 void UpdateSecurityState();
275 void MaybeAddAsProgressListener(nsIWebProgress* aWebProgress);
277 // Called when a navigation forces us to recreate our browsing
278 // context (for example, when switching in or out of the parent
279 // process).
280 // aNewContext is the newly created BrowsingContext that is replacing
281 // us.
282 void ReplacedBy(CanonicalBrowsingContext* aNewContext,
283 const NavigationIsolationOptions& aRemotenessOptions);
285 bool HasHistoryEntry(nsISHEntry* aEntry);
286 bool HasLoadingHistoryEntry(nsISHEntry* aEntry) {
287 for (const LoadingSessionHistoryEntry& loading : mLoadingEntries) {
288 if (loading.mEntry == aEntry) {
289 return true;
292 return false;
295 void SwapHistoryEntries(nsISHEntry* aOldEntry, nsISHEntry* aNewEntry);
297 void AddLoadingSessionHistoryEntry(uint64_t aLoadId,
298 SessionHistoryEntry* aEntry);
300 void GetLoadingSessionHistoryInfoFromParent(
301 Maybe<LoadingSessionHistoryInfo>& aLoadingInfo);
303 void HistoryCommitIndexAndLength();
305 void SynchronizeLayoutHistoryState();
307 void ResetScalingZoom();
309 void SetContainerFeaturePolicy(FeaturePolicy* aContainerFeaturePolicy);
310 FeaturePolicy* GetContainerFeaturePolicy() const {
311 return mContainerFeaturePolicy;
314 void SetRestoreData(SessionStoreRestoreData* aData, ErrorResult& aError);
315 void ClearRestoreState();
316 MOZ_CAN_RUN_SCRIPT_BOUNDARY void RequestRestoreTabContent(
317 WindowGlobalParent* aWindow);
318 already_AddRefed<Promise> GetRestorePromise();
320 nsresult WriteSessionStorageToSessionStore(
321 const nsTArray<SSCacheCopy>& aSesssionStorage, uint32_t aEpoch);
323 void UpdateSessionStoreSessionStorage(const std::function<void()>& aDone);
325 static void UpdateSessionStoreForStorage(uint64_t aBrowsingContextId);
327 // Called when a BrowserParent for this BrowsingContext has been fully
328 // destroyed (i.e. `ActorDestroy` was called).
329 void BrowserParentDestroyed(BrowserParent* aBrowserParent,
330 bool aAbnormalShutdown);
332 void StartUnloadingHost(uint64_t aChildID);
333 void ClearUnloadingHost(uint64_t aChildID);
335 bool AllowedInBFCache(const Maybe<uint64_t>& aChannelId, nsIURI* aNewURI);
337 // Methods for getting and setting the active state for top level
338 // browsing contexts, for the process priority manager.
339 bool IsPriorityActive() const {
340 MOZ_RELEASE_ASSERT(IsTop());
341 return mPriorityActive;
343 void SetPriorityActive(bool aIsActive) {
344 MOZ_RELEASE_ASSERT(IsTop());
345 mPriorityActive = aIsActive;
348 void SetTouchEventsOverride(dom::TouchEventsOverride, ErrorResult& aRv);
349 void SetTargetTopLevelLinkClicksToBlank(bool aTargetTopLevelLinkClicksToBlank,
350 ErrorResult& aRv);
352 bool IsReplaced() const { return mIsReplaced; }
354 const JS::Heap<JS::Value>& PermanentKey() { return mPermanentKey; }
355 void ClearPermanentKey() { mPermanentKey.setNull(); }
356 void MaybeSetPermanentKey(Element* aEmbedder);
358 // When request for page awake, it would increase a count that is used to
359 // prevent whole browsing context tree from being suspended. The request can
360 // be called multiple times. When calling the revoke, it would decrease the
361 // count and once the count reaches to zero, the browsing context tree could
362 // be suspended when the tree is inactive.
363 void AddPageAwakeRequest();
364 void RemovePageAwakeRequest();
366 void CloneDocumentTreeInto(CanonicalBrowsingContext* aSource,
367 const nsACString& aRemoteType,
368 embedding::PrintData&& aPrintData);
370 // Returns a Promise which resolves when cloning documents for printing
371 // finished if this browsing context is cloning document tree.
372 RefPtr<GenericNonExclusivePromise> GetClonePromise() const {
373 return mClonePromise;
376 bool StartApzAutoscroll(float aAnchorX, float aAnchorY, nsViewID aScrollId,
377 uint32_t aPresShellId);
378 void StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId);
380 void AddFinalDiscardListener(std::function<void(uint64_t)>&& aListener);
382 bool ForceAppWindowActive() const { return mForceAppWindowActive; }
383 void SetForceAppWindowActive(bool, ErrorResult&);
384 void RecomputeAppWindowVisibility();
386 already_AddRefed<nsISHEntry> GetMostRecentLoadingSessionHistoryEntry();
388 already_AddRefed<BounceTrackingState> GetBounceTrackingState();
390 protected:
391 // Called when the browsing context is being discarded.
392 void CanonicalDiscard();
394 // Called when the browsing context is being attached.
395 void CanonicalAttach();
397 // Called when the browsing context private mode is changed after
398 // being attached, but before being discarded.
399 void AdjustPrivateBrowsingCount(bool aPrivateBrowsing);
401 using Type = BrowsingContext::Type;
402 CanonicalBrowsingContext(WindowContext* aParentWindow,
403 BrowsingContextGroup* aGroup,
404 uint64_t aBrowsingContextId,
405 uint64_t aOwnerProcessId,
406 uint64_t aEmbedderProcessId, Type aType,
407 FieldValues&& aInit);
409 private:
410 friend class BrowsingContext;
412 virtual ~CanonicalBrowsingContext();
414 class PendingRemotenessChange {
415 public:
416 NS_INLINE_DECL_REFCOUNTING(PendingRemotenessChange)
418 PendingRemotenessChange(CanonicalBrowsingContext* aTarget,
419 RemotenessPromise::Private* aPromise,
420 uint64_t aPendingSwitchId,
421 const NavigationIsolationOptions& aOptions);
423 void Cancel(nsresult aRv);
425 private:
426 friend class CanonicalBrowsingContext;
428 ~PendingRemotenessChange();
429 void ProcessLaunched();
430 void ProcessReady();
431 void MaybeFinish();
432 void Clear();
434 nsresult FinishTopContent();
435 nsresult FinishSubframe();
437 RefPtr<CanonicalBrowsingContext> mTarget;
438 RefPtr<RemotenessPromise::Private> mPromise;
439 RefPtr<ContentParent> mContentParent;
440 RefPtr<BrowsingContextGroup> mSpecificGroup;
442 bool mProcessReady = false;
443 bool mWaitingForPrepareToChange = false;
445 uint64_t mPendingSwitchId;
446 NavigationIsolationOptions mOptions;
449 struct RestoreState {
450 NS_INLINE_DECL_REFCOUNTING(RestoreState)
452 void ClearData() { mData = nullptr; }
453 void Resolve();
455 RefPtr<SessionStoreRestoreData> mData;
456 RefPtr<Promise> mPromise;
457 uint32_t mRequests = 0;
458 uint32_t mResolves = 0;
460 private:
461 ~RestoreState() = default;
464 friend class net::DocumentLoadListener;
465 // Called when a DocumentLoadListener is created to start a load for
466 // this browsing context. Returns false if a higher priority load is
467 // already in-progress and the new one has been rejected.
468 bool StartDocumentLoad(net::DocumentLoadListener* aLoad);
469 // Called once DocumentLoadListener completes handling a load, and it
470 // is either complete, or handed off to the final channel to deliver
471 // data to the destination docshell.
472 // If aContinueNavigating it set, the reference to the DocumentLoadListener
473 // will be cleared to prevent it being cancelled, however the current load ID
474 // will be preserved until `EndDocumentLoad` is called again.
475 void EndDocumentLoad(bool aContinueNavigating);
477 bool SupportsLoadingInParent(nsDocShellLoadState* aLoadState,
478 uint64_t* aOuterWindowId);
480 void HistoryCommitIndexAndLength(
481 const nsID& aChangeID,
482 const CallerWillNotifyHistoryIndexAndLengthChanges& aProofOfCaller);
484 struct UnloadingHost {
485 uint64_t mChildID;
486 nsTArray<std::function<void()>> mCallbacks;
488 nsTArray<UnloadingHost>::iterator FindUnloadingHost(uint64_t aChildID);
490 // Called when we want to show the subframe crashed UI as our previous browser
491 // has become unloaded for one reason or another.
492 void ShowSubframeCrashedUI(BrowserBridgeParent* aBridge);
494 void MaybeScheduleSessionStoreUpdate();
496 void CancelSessionStoreUpdate();
498 void AddPendingDiscard();
500 void RemovePendingDiscard();
502 bool ShouldAddEntryForRefresh(const SessionHistoryEntry* aEntry) {
503 return ShouldAddEntryForRefresh(aEntry->Info().GetURI(),
504 aEntry->Info().HasPostData());
506 bool ShouldAddEntryForRefresh(nsIURI* aNewURI, bool aHasPostData) {
507 nsCOMPtr<nsIURI> currentURI = GetCurrentURI();
508 return BrowsingContext::ShouldAddEntryForRefresh(currentURI, aNewURI,
509 aHasPostData);
512 already_AddRefed<nsDocShellLoadState> CreateLoadInfo(
513 SessionHistoryEntry* aEntry);
515 // XXX(farre): Store a ContentParent pointer here rather than mProcessId?
516 // Indicates which process owns the docshell.
517 uint64_t mProcessId;
519 // Indicates which process owns the embedder element.
520 uint64_t mEmbedderProcessId;
522 uint64_t mCrossGroupOpenerId = 0;
524 // This function will make the top window context reset its
525 // "SHEntryHasUserInteraction" cache that prevents documents from repeatedly
526 // setting user interaction on SH entries. Should be called anytime SH
527 // entries are added or replaced.
528 void ResetSHEntryHasUserInteractionCache();
530 RefPtr<BrowserParent> mCurrentBrowserParent;
532 nsTArray<UnloadingHost> mUnloadingHosts;
534 // The current URI loaded in this BrowsingContext. This value is only set for
535 // BrowsingContexts loaded in content processes.
536 nsCOMPtr<nsIURI> mCurrentRemoteURI;
538 // The current remoteness change which is in a pending state.
539 RefPtr<PendingRemotenessChange> mPendingRemotenessChange;
541 RefPtr<nsSHistory> mSessionHistory;
543 // Tab media controller is used to control all media existing in the same
544 // browsing context tree, so it would only exist in the top level browsing
545 // context.
546 RefPtr<MediaController> mTabMediaController;
548 RefPtr<net::DocumentLoadListener> mCurrentLoad;
550 struct LoadingSessionHistoryEntry {
551 uint64_t mLoadId = 0;
552 RefPtr<SessionHistoryEntry> mEntry;
554 nsTArray<LoadingSessionHistoryEntry> mLoadingEntries;
555 RefPtr<SessionHistoryEntry> mActiveEntry;
557 RefPtr<nsSecureBrowserUI> mSecureBrowserUI;
558 RefPtr<BrowsingContextWebProgress> mWebProgress;
560 nsCOMPtr<nsIWebProgressListener> mDocShellProgressBridge;
561 RefPtr<nsBrowserStatusFilter> mStatusFilter;
563 RefPtr<FeaturePolicy> mContainerFeaturePolicy;
565 friend class BrowserSessionStore;
566 WeakPtr<SessionStoreFormData>& GetSessionStoreFormDataRef() {
567 return mFormdata;
569 WeakPtr<SessionStoreScrollData>& GetSessionStoreScrollDataRef() {
570 return mScroll;
573 WeakPtr<SessionStoreFormData> mFormdata;
574 WeakPtr<SessionStoreScrollData> mScroll;
576 RefPtr<RestoreState> mRestoreState;
578 nsCOMPtr<nsITimer> mSessionStoreSessionStorageUpdateTimer;
580 // If this is a top level context, this is true if our browser ID is marked as
581 // active in the process priority manager.
582 bool mPriorityActive = false;
584 // See CanonicalBrowsingContext.forceAppWindowActive.
585 bool mForceAppWindowActive = false;
587 bool mIsReplaced = false;
589 // A Promise created when cloning documents for printing.
590 RefPtr<GenericNonExclusivePromise> mClonePromise;
592 JS::Heap<JS::Value> mPermanentKey;
594 uint32_t mPendingDiscards = 0;
596 bool mFullyDiscarded = false;
598 nsTArray<std::function<void(uint64_t)>> mFullyDiscardedListeners;
601 } // namespace dom
602 } // namespace mozilla
604 #endif // !defined(mozilla_dom_CanonicalBrowsingContext_h)