Skip to content
Snippets Groups Projects
Verified Commit e14cab18 authored by Tim Huang's avatar Tim Huang Committed by Pier Angelo Vendrame
Browse files

Bug 1842030 - Part 1: Adding CanonicalBrowsingContext::IsPrivateBrowsingActive(). r=nika

The CanonicalBrowsingContext::IsPrivateBrowsingActive() function allows
us to know if private browsing is active. We need it to prevent setting
cookies if there is no active private browsing session.

Differential Revision: https://phabricator.services.mozilla.com/D184010
parent 4028ac81
Branches
No related tags found
1 merge request!768Bug 42090: Rebase release release onto 102.15.1esr
......@@ -1351,6 +1351,11 @@ uint32_t CanonicalBrowsingContext::CountSiteOrigins(
return uniqueSiteOrigins.Count();
}
/* static */
bool CanonicalBrowsingContext::IsPrivateBrowsingActive() {
return gNumberOfPrivateContexts > 0;
}
void CanonicalBrowsingContext::UpdateMediaControlAction(
const MediaControlAction& aAction) {
if (IsDiscarded()) {
......
......
......@@ -201,6 +201,9 @@ class CanonicalBrowsingContext final : public BrowsingContext {
GlobalObject& aGlobal,
const Sequence<mozilla::OwningNonNull<BrowsingContext>>& aRoots);
// Return true if a private browsing session is active.
static bool IsPrivateBrowsingActive();
// This function would propogate the action to its all child browsing contexts
// in content processes.
void UpdateMediaControlAction(const MediaControlAction& aAction);
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment