mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1842030 - Part 1: Adding CanonicalBrowsingContext::IsPrivateBrowsingActive(). r=nika, a=dmeehan
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
This commit is contained in:
parent
dd4b1838be
commit
a00674cffd
@ -1430,6 +1430,11 @@ uint32_t CanonicalBrowsingContext::CountSiteOrigins(
|
||||
return uniqueSiteOrigins.Count();
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool CanonicalBrowsingContext::IsPrivateBrowsingActive() {
|
||||
return gNumberOfPrivateContexts > 0;
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::UpdateMediaControlAction(
|
||||
const MediaControlAction& aAction) {
|
||||
if (IsDiscarded()) {
|
||||
|
@ -202,6 +202,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);
|
||||
|
Loading…
Reference in New Issue
Block a user