From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- caps/BasePrincipal.cpp | 7 ------ caps/BasePrincipal.h | 5 ----- caps/OriginAttributes.cpp | 7 +----- caps/OriginAttributes.h | 18 +-------------- caps/nsIPrincipal.idl | 11 ---------- caps/tests/gtest/TestOriginAttributes.cpp | 6 ----- caps/tests/mochitest/browser_checkloaduri.js | 5 +++-- caps/tests/unit/test_origin.js | 33 ---------------------------- 8 files changed, 5 insertions(+), 87 deletions(-) (limited to 'caps') diff --git a/caps/BasePrincipal.cpp b/caps/BasePrincipal.cpp index 6cd94741b0..a805b6325c 100644 --- a/caps/BasePrincipal.cpp +++ b/caps/BasePrincipal.cpp @@ -1190,13 +1190,6 @@ BasePrincipal::GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) { return NS_OK; } -NS_IMETHODIMP -BasePrincipal::GetIsInIsolatedMozBrowserElement( - bool* aIsInIsolatedMozBrowserElement) { - *aIsInIsolatedMozBrowserElement = IsInIsolatedMozBrowserElement(); - return NS_OK; -} - nsresult BasePrincipal::GetAddonPolicy( extensions::WebExtensionPolicy** aResult) { AssertIsOnMainThread(); diff --git a/caps/BasePrincipal.h b/caps/BasePrincipal.h index 9304be7dee..c188664612 100644 --- a/caps/BasePrincipal.h +++ b/caps/BasePrincipal.h @@ -163,8 +163,6 @@ class BasePrincipal : public nsJSPrincipals { NS_IMETHOD GetIsIpAddress(bool* aIsIpAddress) override; NS_IMETHOD GetIsLocalIpAddress(bool* aIsIpAddress) override; NS_IMETHOD GetIsOnion(bool* aIsOnion) override; - NS_IMETHOD GetIsInIsolatedMozBrowserElement( - bool* aIsInIsolatedMozBrowserElement) final; NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final; NS_IMETHOD GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) final; NS_IMETHOD GetSiteOrigin(nsACString& aSiteOrigin) final; @@ -250,9 +248,6 @@ class BasePrincipal : public nsJSPrincipals { uint32_t PrivateBrowsingId() const { return mOriginAttributes.mPrivateBrowsingId; } - bool IsInIsolatedMozBrowserElement() const { - return mOriginAttributes.mInIsolatedMozBrowser; - } PrincipalKind Kind() const { return mKind; } diff --git a/caps/OriginAttributes.cpp b/caps/OriginAttributes.cpp index 734a230495..211d6b00e7 100644 --- a/caps/OriginAttributes.cpp +++ b/caps/OriginAttributes.cpp @@ -229,10 +229,6 @@ void OriginAttributes::CreateSuffix(nsACString& aStr) const { // naming. // - if (mInIsolatedMozBrowser) { - params.Set(u"inBrowser"_ns, u"1"_ns); - } - if (mUserContextId != nsIScriptSecurityManager::DEFAULT_USER_CONTEXT_ID) { value.Truncate(); value.AppendInt(mUserContextId); @@ -328,14 +324,13 @@ bool OriginAttributes::PopulateFromSuffix(const nsACString& aStr) { MOZ_RELEASE_ASSERT(mPartitionKey.IsEmpty()); return URLParams::Parse( - Substring(aStr, 1, aStr.Length() - 1), + Substring(aStr, 1, aStr.Length() - 1), true, [this](const nsAString& aName, const nsAString& aValue) { if (aName.EqualsLiteral("inBrowser")) { if (!aValue.EqualsLiteral("1")) { return false; } - mInIsolatedMozBrowser = true; return true; } diff --git a/caps/OriginAttributes.h b/caps/OriginAttributes.h index 02e52f0799..faf9d80050 100644 --- a/caps/OriginAttributes.h +++ b/caps/OriginAttributes.h @@ -17,10 +17,6 @@ class OriginAttributes : public dom::OriginAttributesDictionary { public: OriginAttributes() = default; - explicit OriginAttributes(bool aInIsolatedMozBrowser) { - mInIsolatedMozBrowser = aInIsolatedMozBrowser; - } - explicit OriginAttributes(const OriginAttributesDictionary& aOther) : OriginAttributesDictionary(aOther) {} @@ -74,8 +70,7 @@ class OriginAttributes : public dom::OriginAttributesDictionary { } [[nodiscard]] bool EqualsIgnoringFPD(const OriginAttributes& aOther) const { - return mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser && - mUserContextId == aOther.mUserContextId && + return mUserContextId == aOther.mUserContextId && mPrivateBrowsingId == aOther.mPrivateBrowsingId && mGeckoViewSessionContextId == aOther.mGeckoViewSessionContextId; } @@ -159,11 +154,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary { // Performs a match of |aAttrs| against this pattern. bool Matches(const OriginAttributes& aAttrs) const { - if (mInIsolatedMozBrowser.WasPassed() && - mInIsolatedMozBrowser.Value() != aAttrs.mInIsolatedMozBrowser) { - return false; - } - if (mUserContextId.WasPassed() && mUserContextId.Value() != aAttrs.mUserContextId) { return false; @@ -227,12 +217,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary { } bool Overlaps(const OriginAttributesPattern& aOther) const { - if (mInIsolatedMozBrowser.WasPassed() && - aOther.mInIsolatedMozBrowser.WasPassed() && - mInIsolatedMozBrowser.Value() != aOther.mInIsolatedMozBrowser.Value()) { - return false; - } - if (mUserContextId.WasPassed() && aOther.mUserContextId.WasPassed() && mUserContextId.Value() != aOther.mUserContextId.Value()) { return false; diff --git a/caps/nsIPrincipal.idl b/caps/nsIPrincipal.idl index bf60f83b04..a3849dd723 100644 --- a/caps/nsIPrincipal.idl +++ b/caps/nsIPrincipal.idl @@ -586,17 +586,6 @@ interface nsIPrincipal : nsISupports */ [infallible] readonly attribute unsigned long privateBrowsingId; - /** - * Returns true iff the principal is inside an isolated mozbrowser element. - * is not considered to be a mozbrowser element. - *