tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit bb379ced9e9fcfe8a9c420d004b3486ceb699cd2
parent fbce16759594eced2c441974f59f56285cbcff38
Author: Siddhartha <92244610+Witty-31-06@users.noreply.github.com>
Date:   Thu, 27 Nov 2025 10:37:28 +0000

Bug 2000613: Removed the parameter aForeignByAncestorContext in mozilla::net::CookieJarSettings::SetPartitionKey.r=manuel,cookie-reviewers,valentin

Inside the function mozilla::net::CookieJarSettings::SetPartitionKey false is passed as argument to aForeignByAncestorContext parameter of
OriginAttributes::SetPartitionKey

Differential Revision: https://phabricator.services.mozilla.com/D274092

Diffstat:
Mdom/base/Document.cpp | 2+-
Mdom/serviceworkers/ServiceWorkerPrivate.cpp | 3+--
Mdom/serviceworkers/ServiceWorkerScriptCache.cpp | 3+--
Mnetwerk/cookie/CookieJarSettings.cpp | 7+++----
Mnetwerk/cookie/CookieJarSettings.h | 2+-
Mtoolkit/components/antitracking/AntiTrackingUtils.cpp | 2+-
6 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp @@ -17495,7 +17495,7 @@ void Document::MaybeRecomputePartitionKey() { // Set the partition key to the document's node principal. So we will use the // right partition key afterward. mozilla::net::CookieJarSettings::Cast(mCookieJarSettings) - ->SetPartitionKey(originURI, false); + ->SetPartitionKey(originURI); } bool Document::RecomputeResistFingerprinting(bool aForceRefreshRTPCallerType) { diff --git a/dom/serviceworkers/ServiceWorkerPrivate.cpp b/dom/serviceworkers/ServiceWorkerPrivate.cpp @@ -643,8 +643,7 @@ nsresult ServiceWorkerPrivate::Initialize() { } } } else { - net::CookieJarSettings::Cast(cookieJarSettings) - ->SetPartitionKey(uri, false); + net::CookieJarSettings::Cast(cookieJarSettings)->SetPartitionKey(uri); firstPartyURI = uri; // The service worker is for a first-party context, we can use the uri of diff --git a/dom/serviceworkers/ServiceWorkerScriptCache.cpp b/dom/serviceworkers/ServiceWorkerScriptCache.cpp @@ -676,8 +676,7 @@ nsresult CompareNetwork::Initialize(nsIPrincipal* aPrincipal, net::CookieJarSettings::Cast(cookieJarSettings) ->SetPartitionKey(aPrincipal->OriginAttributesRef().mPartitionKey); } else { - net::CookieJarSettings::Cast(cookieJarSettings) - ->SetPartitionKey(uri, false); + net::CookieJarSettings::Cast(cookieJarSettings)->SetPartitionKey(uri); } // Note that because there is no "serviceworker" RequestContext type, we can diff --git a/netwerk/cookie/CookieJarSettings.cpp b/netwerk/cookie/CookieJarSettings.cpp @@ -233,7 +233,7 @@ CookieJarSettings::InitWithURI(nsIURI* aURI, bool aIsPrivate) { mCookieBehavior = nsICookieManager::GetCookieBehavior(aIsPrivate); - SetPartitionKey(aURI, false); + SetPartitionKey(aURI); return NS_OK; } @@ -560,12 +560,11 @@ already_AddRefed<nsICookieJarSettings> CookieJarSettings::Merge( return newCookieJarSettings.forget(); } -void CookieJarSettings::SetPartitionKey(nsIURI* aURI, - bool aForeignByAncestorContext) { +void CookieJarSettings::SetPartitionKey(nsIURI* aURI) { MOZ_ASSERT(aURI); OriginAttributes attrs; - attrs.SetPartitionKey(aURI, aForeignByAncestorContext); + attrs.SetPartitionKey(aURI, false); mPartitionKey = std::move(attrs.mPartitionKey); mToBeMerged = true; diff --git a/netwerk/cookie/CookieJarSettings.h b/netwerk/cookie/CookieJarSettings.h @@ -173,7 +173,7 @@ class CookieJarSettings final : public nsICookieJarSettings { mIsOnContentBlockingAllowList = aIsOnContentBlockingAllowList; } - void SetPartitionKey(nsIURI* aURI, bool aForeignByAncestorContext); + void SetPartitionKey(nsIURI* aURI); void SetPartitionKey(const nsAString& aPartitionKey) { mPartitionKey = aPartitionKey; } diff --git a/toolkit/components/antitracking/AntiTrackingUtils.cpp b/toolkit/components/antitracking/AntiTrackingUtils.cpp @@ -1349,7 +1349,7 @@ void AntiTrackingUtils::UpdateAntiTrackingInfoForChannel(nsIChannel* aChannel) { // propagated to non-top level loads via CookieJarSetting. nsCOMPtr<nsIURI> uri; (void)aChannel->GetURI(getter_AddRefs(uri)); - net::CookieJarSettings::Cast(cookieJarSettings)->SetPartitionKey(uri, false); + net::CookieJarSettings::Cast(cookieJarSettings)->SetPartitionKey(uri); // Generate the fingerprinting randomization key for top-level loads. The key // will automatically be propagated to sub loads.