Bug 1687618 - Remove isolated and topWindowOrigin from altServices r=necko-reviewers,dragana
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 26 Jan 2021 11:08:46 +0000
changeset 564803 b5ddfd9ca753c5c35f900996e272bef67d2fd21f
parent 564802 be4a98cebee003dad52b8a583c423a174ec7554d
child 564804 41e741a5e26c8baa3df86ee623fa09add3648262
push id38147
push userapavel@mozilla.com
push dateWed, 27 Jan 2021 21:36:46 +0000
treeherdermozilla-central@050d232035a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnecko-reviewers, dragana
bugs1687618
milestone87.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1687618 - Remove isolated and topWindowOrigin from altServices r=necko-reviewers,dragana Differential Revision: https://phabricator.services.mozilla.com/D102714
netwerk/protocol/http/AltServiceChild.cpp
netwerk/protocol/http/AltServiceChild.h
netwerk/protocol/http/AltServiceParent.cpp
netwerk/protocol/http/AltServiceParent.h
netwerk/protocol/http/AlternateServices.cpp
netwerk/protocol/http/AlternateServices.h
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/PAltService.ipdl
netwerk/protocol/http/TRRServiceChannel.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpHandler.h
--- a/netwerk/protocol/http/AltServiceChild.cpp
+++ b/netwerk/protocol/http/AltServiceChild.cpp
@@ -61,37 +61,35 @@ void AltServiceChild::ClearHostMapping(n
   RefPtr<nsHttpConnectionInfo> ci = aCi->Clone();
   auto task = [ci{std::move(ci)}]() {
     if (!EnsureAltServiceChild()) {
       return;
     }
 
     if (!ci->GetOrigin().IsEmpty() && sAltServiceChild->CanSend()) {
       Unused << sAltServiceChild->SendClearHostMapping(
-          ci->GetOrigin(), ci->OriginPort(), ci->GetOriginAttributes(),
-          ""_ns /* topWindowOrigin */);
+          ci->GetOrigin(), ci->OriginPort(), ci->GetOriginAttributes());
     }
   };
 
   if (!NS_IsMainThread()) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(NS_NewRunnableFunction(
         "net::AltServiceChild::ClearHostMapping", task)));
     return;
   }
 
   task();
 }
 
 // static
 void AltServiceChild::ProcessHeader(
     const nsCString& aBuf, const nsCString& aOriginScheme,
     const nsCString& aOriginHost, int32_t aOriginPort,
-    const nsCString& aUsername, const nsCString& aTopWindowOrigin,
-    bool aPrivateBrowsing, bool aIsolated, nsIInterfaceRequestor* aCallbacks,
-    nsProxyInfo* aProxyInfo, uint32_t aCaps,
+    const nsCString& aUsername, bool aPrivateBrowsing,
+    nsIInterfaceRequestor* aCallbacks, nsProxyInfo* aProxyInfo, uint32_t aCaps,
     const OriginAttributes& aOriginAttributes) {
   LOG(("AltServiceChild::ProcessHeader"));
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!EnsureAltServiceChild()) {
     return;
   }
 
@@ -101,14 +99,13 @@ void AltServiceChild::ProcessHeader(
 
   nsTArray<ProxyInfoCloneArgs> proxyInfoArray;
   if (aProxyInfo) {
     nsProxyInfo::SerializeProxyInfo(aProxyInfo, proxyInfoArray);
   }
 
   Unused << sAltServiceChild->SendProcessHeader(
       aBuf, aOriginScheme, aOriginHost, aOriginPort, aUsername,
-      aTopWindowOrigin, aPrivateBrowsing, aIsolated, proxyInfoArray, aCaps,
-      aOriginAttributes);
+      aPrivateBrowsing, proxyInfoArray, aCaps, aOriginAttributes);
 }
 
 }  // namespace net
 }  // namespace mozilla
--- a/netwerk/protocol/http/AltServiceChild.h
+++ b/netwerk/protocol/http/AltServiceChild.h
@@ -20,19 +20,17 @@ class AltServiceChild final : public PAl
  public:
   NS_INLINE_DECL_REFCOUNTING(AltServiceChild, override)
 
   static bool EnsureAltServiceChild();
   static void ClearHostMapping(nsHttpConnectionInfo* aCi);
   static void ProcessHeader(const nsCString& aBuf,
                             const nsCString& aOriginScheme,
                             const nsCString& aOriginHost, int32_t aOriginPort,
-                            const nsCString& aUsername,
-                            const nsCString& aTopWindowOrigin,
-                            bool aPrivateBrowsing, bool aIsolated,
+                            const nsCString& aUsername, bool aPrivateBrowsing,
                             nsIInterfaceRequestor* aCallbacks,
                             nsProxyInfo* aProxyInfo, uint32_t aCaps,
                             const OriginAttributes& aOriginAttributes);
 
  private:
   AltServiceChild();
   virtual ~AltServiceChild();
 };
--- a/netwerk/protocol/http/AltServiceParent.cpp
+++ b/netwerk/protocol/http/AltServiceParent.cpp
@@ -11,40 +11,37 @@
 #include "AlternateServices.h"
 #include "nsHttpHandler.h"
 
 namespace mozilla {
 namespace net {
 
 mozilla::ipc::IPCResult AltServiceParent::RecvClearHostMapping(
     const nsCString& aHost, const int32_t& aPort,
-    const OriginAttributes& aOriginAttributes,
-    const nsCString& aTopWindowOrigin) {
+    const OriginAttributes& aOriginAttributes) {
   LOG(("AltServiceParent::RecvClearHostMapping [this=%p]\n", this));
   if (gHttpHandler) {
-    gHttpHandler->AltServiceCache()->ClearHostMapping(
-        aHost, aPort, aOriginAttributes, aTopWindowOrigin);
+    gHttpHandler->AltServiceCache()->ClearHostMapping(aHost, aPort,
+                                                      aOriginAttributes);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult AltServiceParent::RecvProcessHeader(
     const nsCString& aBuf, const nsCString& aOriginScheme,
     const nsCString& aOriginHost, const int32_t& aOriginPort,
-    const nsACString& aUsername, const nsACString& aTopWindowOrigin,
-    const bool& aPrivateBrowsing, const bool& aIsolated,
+    const nsACString& aUsername, const bool& aPrivateBrowsing,
     nsTArray<ProxyInfoCloneArgs>&& aProxyInfo, const uint32_t& aCaps,
     const OriginAttributes& aOriginAttributes) {
   LOG(("AltServiceParent::RecvProcessHeader [this=%p]\n", this));
   nsProxyInfo* pi = aProxyInfo.IsEmpty()
                         ? nullptr
                         : nsProxyInfo::DeserializeProxyInfo(aProxyInfo);
   AltSvcMapping::ProcessHeader(aBuf, aOriginScheme, aOriginHost, aOriginPort,
-                               aUsername, aTopWindowOrigin, aPrivateBrowsing,
-                               aIsolated, nullptr, pi, aCaps,
+                               aUsername, aPrivateBrowsing, nullptr, pi, aCaps,
                                aOriginAttributes);
   return IPC_OK();
 }
 
 void AltServiceParent::ActorDestroy(ActorDestroyReason aWhy) {
   LOG(("AltServiceParent::ActorDestroy [this=%p]\n", this));
 }
 
--- a/netwerk/protocol/http/AltServiceParent.h
+++ b/netwerk/protocol/http/AltServiceParent.h
@@ -13,24 +13,22 @@ namespace net {
 
 class AltServiceParent final : public PAltServiceParent {
  public:
   NS_INLINE_DECL_REFCOUNTING(AltServiceParent, override)
   AltServiceParent() = default;
 
   mozilla::ipc::IPCResult RecvClearHostMapping(
       const nsCString& aHost, const int32_t& aPort,
-      const OriginAttributes& aOriginAttributes,
-      const nsCString& aTopWindowOrigin);
+      const OriginAttributes& aOriginAttributes);
 
   mozilla::ipc::IPCResult RecvProcessHeader(
       const nsCString& aBuf, const nsCString& aOriginScheme,
       const nsCString& aOriginHost, const int32_t& aOriginPort,
-      const nsACString& aUsername, const nsACString& aTopWindowOrigin,
-      const bool& aPrivateBrowsing, const bool& aIsolated,
+      const nsACString& aUsername, const bool& aPrivateBrowsing,
       nsTArray<ProxyInfoCloneArgs>&& aProxyInfo, const uint32_t& aCaps,
       const OriginAttributes& aOriginAttributes);
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
   virtual ~AltServiceParent() = default;
 };
--- a/netwerk/protocol/http/AlternateServices.cpp
+++ b/netwerk/protocol/http/AlternateServices.cpp
@@ -53,18 +53,18 @@ static nsresult SchemeIsHTTPS(const nsAC
 
 bool AltSvcMapping::AcceptableProxy(nsProxyInfo* proxyInfo) {
   return !proxyInfo || proxyInfo->IsDirect() || proxyInfo->IsSOCKS();
 }
 
 void AltSvcMapping::ProcessHeader(
     const nsCString& buf, const nsCString& originScheme,
     const nsCString& originHost, int32_t originPort, const nsACString& username,
-    const nsACString& topWindowOrigin, bool privateBrowsing, bool isolated,
-    nsIInterfaceRequestor* callbacks, nsProxyInfo* proxyInfo, uint32_t caps,
+    bool privateBrowsing, nsIInterfaceRequestor* callbacks,
+    nsProxyInfo* proxyInfo, uint32_t caps,
     const OriginAttributes& originAttributes,
     bool aDontValidate /* = false */) {  // aDontValidate is only used for
                                          // testing
   MOZ_ASSERT(NS_IsMainThread());
   LOG(("AltSvcMapping::ProcessHeader: %s\n", buf.get()));
 
   if (StaticPrefs::network_http_altsvc_proxy_checks() &&
       !AcceptableProxy(proxyInfo)) {
@@ -132,18 +132,18 @@ void AltSvcMapping::ProcessHeader(
       }
     }
 
     if (clearEntry) {
       nsCString suffix;
       originAttributes.CreateSuffix(suffix);
       LOG(("Alt Svc clearing mapping for %s:%d:%s", originHost.get(),
            originPort, suffix.get()));
-      gHttpHandler->AltServiceCache()->ClearHostMapping(
-          originHost, originPort, originAttributes, topWindowOrigin);
+      gHttpHandler->AltServiceCache()->ClearHostMapping(originHost, originPort,
+                                                        originAttributes);
       continue;
     }
 
     if (NS_FAILED(NS_CheckPortSafety(portno, originScheme.get()))) {
       LOG(("Alt Svc doesn't allow port %d, ignoring", portno));
       continue;
     }
 
@@ -167,62 +167,61 @@ void AltSvcMapping::ProcessHeader(
       LOG(("Alt Svc unknown protocol %s, ignoring", npnToken.get()));
       continue;
     }
 
     if (isHttp3) {
       http3Found = true;
     }
 
-    RefPtr<AltSvcMapping> mapping = new AltSvcMapping(
-        gHttpHandler->AltServiceCache()->GetStoragePtr(),
-        gHttpHandler->AltServiceCache()->StorageEpoch(), originScheme,
-        originHost, originPort, username, topWindowOrigin, privateBrowsing,
-        isolated, NowInSeconds() + maxage, hostname, portno, npnToken,
-        originAttributes, isHttp3);
+    RefPtr<AltSvcMapping> mapping =
+        new AltSvcMapping(gHttpHandler->AltServiceCache()->GetStoragePtr(),
+                          gHttpHandler->AltServiceCache()->StorageEpoch(),
+                          originScheme, originHost, originPort, username,
+                          privateBrowsing, NowInSeconds() + maxage, hostname,
+                          portno, npnToken, originAttributes, isHttp3);
     if (mapping->TTL() <= 0) {
       LOG(("Alt Svc invalid map"));
       mapping = nullptr;
       // since this isn't a parse error, let's clear any existing mapping
       // as that would have happened if we had accepted the parameters.
-      gHttpHandler->AltServiceCache()->ClearHostMapping(
-          originHost, originPort, originAttributes, topWindowOrigin);
+      gHttpHandler->AltServiceCache()->ClearHostMapping(originHost, originPort,
+                                                        originAttributes);
     } else if (!aDontValidate) {
       gHttpHandler->UpdateAltServiceMapping(mapping, proxyInfo, callbacks, caps,
                                             originAttributes);
     } else {
       gHttpHandler->UpdateAltServiceMappingWithoutValidation(
           mapping, proxyInfo, callbacks, caps, originAttributes);
     }
   }
 
   if (numEntriesInHeader) {  // Ignore headers that were just "alt-svc: clear"
     Telemetry::Accumulate(Telemetry::HTTP_ALTSVC_ENTRIES_PER_HEADER,
                           numEntriesInHeader);
   }
 }
 
-AltSvcMapping::AltSvcMapping(
-    DataStorage* storage, int32_t epoch, const nsACString& originScheme,
-    const nsACString& originHost, int32_t originPort,
-    const nsACString& username, const nsACString& topWindowOrigin,
-    bool privateBrowsing, bool isolated, uint32_t expiresAt,
-    const nsACString& alternateHost, int32_t alternatePort,
-    const nsACString& npnToken, const OriginAttributes& originAttributes,
-    bool aIsHttp3)
+AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch,
+                             const nsACString& originScheme,
+                             const nsACString& originHost, int32_t originPort,
+                             const nsACString& username, bool privateBrowsing,
+                             uint32_t expiresAt,
+                             const nsACString& alternateHost,
+                             int32_t alternatePort, const nsACString& npnToken,
+                             const OriginAttributes& originAttributes,
+                             bool aIsHttp3)
     : mStorage(storage),
       mStorageEpoch(epoch),
       mAlternateHost(alternateHost),
       mAlternatePort(alternatePort),
       mOriginHost(originHost),
       mOriginPort(originPort),
       mUsername(username),
-      mTopWindowOrigin(topWindowOrigin),
       mPrivate(privateBrowsing),
-      mIsolated(isolated),
       mExpiresAt(expiresAt),
       mValidated(false),
       mMixedScheme(false),
       mNPNToken(npnToken),
       mOriginAttributes(originAttributes),
       mSyncOnlyOnSuccess(false),
       mIsHttp3(aIsHttp3) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -255,25 +254,26 @@ AltSvcMapping::AltSvcMapping(
     // the same host:port because protocol(UDP vs. TCP) is always different and
     // we are not connecting to the same end point.
     LOG(("Alt Svc is also origin Svc - ignoring\n"));
     mExpiresAt = 0;  // invalid
   }
 
   if (mExpiresAt) {
     MakeHashKey(mHashKey, originScheme, mOriginHost, mOriginPort, mPrivate,
-                mIsolated, mTopWindowOrigin, mOriginAttributes, mIsHttp3);
+                mOriginAttributes, mIsHttp3);
   }
 }
 
-void AltSvcMapping::MakeHashKey(
-    nsCString& outKey, const nsACString& originScheme,
-    const nsACString& originHost, int32_t originPort, bool privateBrowsing,
-    bool isolated, const nsACString& topWindowOrigin,
-    const OriginAttributes& originAttributes, bool aHttp3) {
+void AltSvcMapping::MakeHashKey(nsCString& outKey,
+                                const nsACString& originScheme,
+                                const nsACString& originHost,
+                                int32_t originPort, bool privateBrowsing,
+                                const OriginAttributes& originAttributes,
+                                bool aHttp3) {
   outKey.Truncate();
 
   if (originPort == -1) {
     bool isHttps = originScheme.EqualsLiteral("https");
     originPort = isHttps ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT;
   }
 
   outKey.Append(originScheme);
@@ -284,23 +284,16 @@ void AltSvcMapping::MakeHashKey(
   outKey.Append(':');
   outKey.Append(privateBrowsing ? 'P' : '.');
   outKey.Append(':');
   nsAutoCString suffix;
   originAttributes.CreateSuffix(suffix);
   outKey.Append(suffix);
   outKey.Append(':');
 
-  if (isolated) {
-    outKey.Append('I');
-    outKey.Append(':');
-    outKey.Append(topWindowOrigin);
-    outKey.Append(
-        '|');  // Be careful, the top window origin may contain colons!
-  }
   outKey.Append(aHttp3 ? '3' : '.');
 }
 
 int32_t AltSvcMapping::TTL() { return mExpiresAt - NowInSeconds(); }
 
 void AltSvcMapping::SyncString(const nsCString& str) {
   MOZ_ASSERT(NS_IsMainThread());
   mStorage->Put(HashKey(), str,
@@ -398,19 +391,19 @@ void AltSvcMapping::Serialize(nsCString&
   out.AppendInt(mStorageEpoch);
   out.Append(':');
   out.Append(mMixedScheme ? 'y' : 'n');
   out.Append(':');
   nsAutoCString suffix;
   mOriginAttributes.CreateSuffix(suffix);
   out.Append(suffix);
   out.Append(':');
-  out.Append(mTopWindowOrigin);
-  out.Append('|');  // Be careful, the top window origin may contain colons!
-  out.Append(mIsolated ? 'y' : 'n');
+  out.Append(""_ns);  // Formerly topWindowOrigin. Now unused empty string.
+  out.Append('|');    // Be careful, the top window origin may contain colons!
+  out.Append('n');  // Formerly mIsolated. Now always 'n'. Should remove someday
   out.Append(':');
   out.Append(mIsHttp3 ? 'y' : 'n');
   out.Append(':');
   // Add code to serialize new members here!
 }
 
 AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch,
                              const nsCString& str)
@@ -466,28 +459,27 @@ AltSvcMapping::AltSvcMapping(DataStorage
     mMixedScheme = Substring(str, start, idx - start).EqualsLiteral("y");
     _NS_NEXT_TOKEN;
     Unused << mOriginAttributes.PopulateFromSuffix(
         Substring(str, start, idx - start));
     // The separator after the top window origin is a pipe character since the
     // origin string can contain colons.
     separator = '|';
     _NS_NEXT_TOKEN;
-    mTopWindowOrigin = Substring(str, start, idx - start);
+    // TopWindowOrigin used to be encoded here. Now it's unused.
     separator = ':';
     _NS_NEXT_TOKEN;
-    mIsolated = Substring(str, start, idx - start).EqualsLiteral("y");
+    // mIsolated used to be encoded here. Now it's unused.
     _NS_NEXT_TOKEN;
     mIsHttp3 = Substring(str, start, idx - start).EqualsLiteral("y");
     // Add code to deserialize new members here!
 #undef _NS_NEXT_TOKEN
 
     MakeHashKey(mHashKey, mHttps ? "https"_ns : "http"_ns, mOriginHost,
-                mOriginPort, mPrivate, mIsolated, mTopWindowOrigin,
-                mOriginAttributes, mIsHttp3);
+                mOriginPort, mPrivate, mOriginAttributes, mIsHttp3);
   } while (false);
 }
 
 AltSvcMappingValidator::AltSvcMappingValidator(AltSvcMapping* aMap)
     : mMapping(aMap) {
   LOG(("AltSvcMappingValidator ctor %p map %p [%s -> %s]", this, aMap,
        aMap->OriginHost().get(), aMap->AlternateHost().get()));
   MOZ_ASSERT(mMapping);
@@ -1132,19 +1124,18 @@ void AltSvcCache::UpdateAltServiceMappin
       LOG(("AltSvcCache::UpdateAltServiceMapping %p .wk checker started %p\n",
            this, checker));
     }
   }
 }
 
 already_AddRefed<AltSvcMapping> AltSvcCache::GetAltServiceMapping(
     const nsACString& scheme, const nsACString& host, int32_t port,
-    bool privateBrowsing, bool isolated, const nsACString& topWindowOrigin,
-    const OriginAttributes& originAttributes, bool aHttp2Allowed,
-    bool aHttp3Allowed) {
+    bool privateBrowsing, const OriginAttributes& originAttributes,
+    bool aHttp2Allowed, bool aHttp3Allowed) {
   EnsureStorageInited();
 
   bool isHTTPS;
   if (NS_FAILED(SchemeIsHTTPS(scheme, isHTTPS))) {
     return nullptr;
   }
   if (!gHttpHandler->AllowAltSvc()) {
     return nullptr;
@@ -1152,35 +1143,33 @@ already_AddRefed<AltSvcMapping> AltSvcCa
   if (!gHttpHandler->AllowAltSvcOE() && !isHTTPS) {
     return nullptr;
   }
 
   // First look for HTTP3
   if (aHttp3Allowed) {
     nsAutoCString key;
     AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing,
-                               isolated, topWindowOrigin, originAttributes,
-                               true);
+                               originAttributes, true);
     RefPtr<AltSvcMapping> existing = LookupMapping(key, privateBrowsing);
     LOG(
         ("AltSvcCache::GetAltServiceMapping %p key=%s "
          "existing=%p validated=%d ttl=%d",
          this, key.get(), existing.get(), existing ? existing->Validated() : 0,
          existing ? existing->TTL() : 0));
     if (existing && existing->Validated()) {
       return existing.forget();
     }
   }
 
   // Now look for HTTP2.
   if (aHttp2Allowed) {
     nsAutoCString key;
     AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing,
-                               isolated, topWindowOrigin, originAttributes,
-                               false);
+                               originAttributes, false);
     RefPtr<AltSvcMapping> existing = LookupMapping(key, privateBrowsing);
     LOG(
         ("AltSvcCache::GetAltServiceMapping %p key=%s "
          "existing=%p validated=%d ttl=%d",
          this, key.get(), existing.get(), existing ? existing->Validated() : 0,
          existing ? existing->TTL() : 0));
     if (existing && existing->Validated()) {
       return existing.forget();
@@ -1188,81 +1177,73 @@ already_AddRefed<AltSvcMapping> AltSvcCa
   }
 
   return nullptr;
 }
 
 class ProxyClearHostMapping : public Runnable {
  public:
   explicit ProxyClearHostMapping(const nsACString& host, int32_t port,
-                                 const OriginAttributes& originAttributes,
-                                 const nsACString& topWindowOrigin)
+                                 const OriginAttributes& originAttributes)
       : Runnable("net::ProxyClearHostMapping"),
         mHost(host),
         mPort(port),
-        mOriginAttributes(originAttributes),
-        mTopWindowOrigin(topWindowOrigin) {}
+        mOriginAttributes(originAttributes) {}
 
   NS_IMETHOD Run() override {
     MOZ_ASSERT(NS_IsMainThread());
-    gHttpHandler->AltServiceCache()->ClearHostMapping(
-        mHost, mPort, mOriginAttributes, mTopWindowOrigin);
+    gHttpHandler->AltServiceCache()->ClearHostMapping(mHost, mPort,
+                                                      mOriginAttributes);
     return NS_OK;
   }
 
  private:
   nsCString mHost;
   int32_t mPort;
   OriginAttributes mOriginAttributes;
-  nsCString mTopWindowOrigin;
 };
 
 void AltSvcCache::ClearHostMapping(const nsACString& host, int32_t port,
-                                   const OriginAttributes& originAttributes,
-                                   const nsACString& topWindowOrigin) {
+                                   const OriginAttributes& originAttributes) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   if (!NS_IsMainThread()) {
-    nsCOMPtr<nsIRunnable> event = new ProxyClearHostMapping(
-        host, port, originAttributes, topWindowOrigin);
+    nsCOMPtr<nsIRunnable> event =
+        new ProxyClearHostMapping(host, port, originAttributes);
     if (event) {
       NS_DispatchToMainThread(event);
     }
     return;
   }
   nsAutoCString key;
   for (int secure = 0; secure < 2; ++secure) {
     constexpr auto http = "http"_ns;
     constexpr auto https = "https"_ns;
     const nsLiteralCString& scheme = secure ? https : http;
     for (int pb = 1; pb >= 0; --pb) {
-      for (int isolate = 0; isolate < 2; ++isolate) {
-        AltSvcMapping::MakeHashKey(key, scheme, host, port, bool(pb),
-                                   bool(isolate), topWindowOrigin,
-                                   originAttributes, false);
-        RefPtr<AltSvcMapping> existing = LookupMapping(key, bool(pb));
-        if (existing) {
-          existing->SetExpired();
-        }
-        AltSvcMapping::MakeHashKey(key, scheme, host, port, bool(pb),
-                                   bool(isolate), topWindowOrigin,
-                                   originAttributes, true);
-        existing = LookupMapping(key, bool(pb));
-        if (existing) {
-          existing->SetExpired();
-        }
+      AltSvcMapping::MakeHashKey(key, scheme, host, port, bool(pb),
+                                 originAttributes, false);
+      RefPtr<AltSvcMapping> existing = LookupMapping(key, bool(pb));
+      if (existing) {
+        existing->SetExpired();
+      }
+      AltSvcMapping::MakeHashKey(key, scheme, host, port, bool(pb),
+                                 originAttributes, true);
+      existing = LookupMapping(key, bool(pb));
+      if (existing) {
+        existing->SetExpired();
       }
     }
   }
 }
 
 void AltSvcCache::ClearHostMapping(nsHttpConnectionInfo* ci) {
   if (!ci->GetOrigin().IsEmpty()) {
     ClearHostMapping(ci->GetOrigin(), ci->OriginPort(),
-                     ci->GetOriginAttributes(), ""_ns /* topWindowOrigin */);
+                     ci->GetOriginAttributes());
   }
 }
 
 void AltSvcCache::ClearAltServiceMappings() {
   MOZ_ASSERT(NS_IsMainThread());
   if (mStorage) {
     mStorage->Clear();
   }
--- a/netwerk/protocol/http/AlternateServices.h
+++ b/netwerk/protocol/http/AlternateServices.h
@@ -45,32 +45,30 @@ class WellKnownChecker;
 
 class AltSvcMapping {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AltSvcMapping)
 
  private:  // ctor from ProcessHeader
   AltSvcMapping(DataStorage* storage, int32_t storageEpoch,
                 const nsACString& originScheme, const nsACString& originHost,
                 int32_t originPort, const nsACString& username,
-                const nsACString& topWindowOrigin, bool privateBrowsing,
-                bool isolated, uint32_t expiresAt,
+                bool privateBrowsing, uint32_t expiresAt,
                 const nsACString& alternateHost, int32_t alternatePort,
                 const nsACString& npnToken,
                 const OriginAttributes& originAttributes, bool aIsHttp3);
 
  public:
   AltSvcMapping(DataStorage* storage, int32_t storageEpoch,
                 const nsCString& serialized);
 
   static void ProcessHeader(
       const nsCString& buf, const nsCString& originScheme,
       const nsCString& originHost, int32_t originPort,
-      const nsACString& username, const nsACString& topWindowOrigin,
-      bool privateBrowsing, bool isolated, nsIInterfaceRequestor* callbacks,
-      nsProxyInfo* proxyInfo, uint32_t caps,
+      const nsACString& username, bool privateBrowsing,
+      nsIInterfaceRequestor* callbacks, nsProxyInfo* proxyInfo, uint32_t caps,
       const OriginAttributes& originAttributes,
       bool aDontValidate = false);  // aDontValidate is only used for testing!
 
   // AcceptableProxy() decides whether a particular proxy configuration (pi) is
   // suitable for use with Alt-Svc. No proxy (including a null pi) is suitable.
   static bool AcceptableProxy(nsProxyInfo* pi);
 
   const nsCString& AlternateHost() const { return mAlternateHost; }
@@ -84,29 +82,27 @@ class AltSvcMapping {
   bool HTTPS() { return mHttps; }
 
   void GetConnectionInfo(nsHttpConnectionInfo** outCI, nsProxyInfo* pi,
                          const OriginAttributes& originAttributes);
 
   int32_t TTL();
   int32_t StorageEpoch() { return mStorageEpoch; }
   bool Private() { return mPrivate; }
-  bool Isolated() { return mIsolated; }
 
   void SetValidated(bool val);
   void SetMixedScheme(bool val);
   void SetExpiresAt(int32_t val);
   void SetExpired();
   void Sync();
   void SetSyncOnlyOnSuccess(bool aSOOS) { mSyncOnlyOnSuccess = aSOOS; }
 
   static void MakeHashKey(nsCString& outKey, const nsACString& originScheme,
                           const nsACString& originHost, int32_t originPort,
-                          bool privateBrowsing, bool isolated,
-                          const nsACString& topWindowOrigin,
+                          bool privateBrowsing,
                           const OriginAttributes& originAttributes,
                           bool aIsHttp3);
 
   bool IsHttp3() { return mIsHttp3; }
   const nsCString& NPNToken() const { return mNPNToken; }
 
  private:
   virtual ~AltSvcMapping() = default;
@@ -120,19 +116,17 @@ class AltSvcMapping {
   // If you change any of these members, update Serialize()
   nsCString mAlternateHost;
   MOZ_INIT_OUTSIDE_CTOR int32_t mAlternatePort;
 
   nsCString mOriginHost;
   MOZ_INIT_OUTSIDE_CTOR int32_t mOriginPort;
 
   nsCString mUsername;
-  nsCString mTopWindowOrigin;
   MOZ_INIT_OUTSIDE_CTOR bool mPrivate;
-  MOZ_INIT_OUTSIDE_CTOR bool mIsolated;
 
   MOZ_INIT_OUTSIDE_CTOR uint32_t mExpiresAt;  // alt-svc mappping
 
   MOZ_INIT_OUTSIDE_CTOR bool mValidated;
   MOZ_INIT_OUTSIDE_CTOR bool mHttps;  // origin is https://
   MOZ_INIT_OUTSIDE_CTOR bool
       mMixedScheme;  // .wk allows http and https on same con
 
@@ -193,23 +187,21 @@ class AltSvcCache {
       uint32_t caps,
       const OriginAttributes& originAttributes);  // main thread
   void UpdateAltServiceMappingWithoutValidation(
       AltSvcMapping* map, nsProxyInfo* pi, nsIInterfaceRequestor*,
       uint32_t caps,
       const OriginAttributes& originAttributes);  // main thread
   already_AddRefed<AltSvcMapping> GetAltServiceMapping(
       const nsACString& scheme, const nsACString& host, int32_t port, bool pb,
-      bool isolated, const nsACString& topWindowOrigin,
       const OriginAttributes& originAttributes, bool aHttp2Allowed,
       bool aHttp3Allowed);
   void ClearAltServiceMappings();
   void ClearHostMapping(const nsACString& host, int32_t port,
-                        const OriginAttributes& originAttributes,
-                        const nsACString& topWindowOrigin);
+                        const OriginAttributes& originAttributes);
   void ClearHostMapping(nsHttpConnectionInfo* ci);
   DataStorage* GetStoragePtr() { return mStorage.get(); }
   int32_t StorageEpoch() { return mStorageEpoch; }
   nsresult GetAltSvcCacheKeys(nsTArray<nsCString>& value);
 
  private:
   void EnsureStorageInited();
   already_AddRefed<AltSvcMapping> LookupMapping(const nsCString& key,
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -2379,25 +2379,25 @@ class UpdateAltSvcEvent : public Runnabl
     }
     uri->GetScheme(originScheme);
     uri->GetHost(originHost);
     uri->GetPort(&originPort);
 
     if (XRE_IsSocketProcess()) {
       AltServiceChild::ProcessHeader(
           mHeader, originScheme, originHost, originPort, mCI->GetUsername(),
-          ""_ns /* topWindowOrigin*/, mCI->GetPrivate(), false, mCallbacks,
-          mCI->ProxyInfo(), 0, mCI->GetOriginAttributes());
+          mCI->GetPrivate(), mCallbacks, mCI->ProxyInfo(), 0,
+          mCI->GetOriginAttributes());
       return NS_OK;
     }
 
-    AltSvcMapping::ProcessHeader(
-        mHeader, originScheme, originHost, originPort, mCI->GetUsername(),
-        ""_ns /* topWindowOrigin*/, mCI->GetPrivate(), false, nullptr,
-        mCI->ProxyInfo(), 0, mCI->GetOriginAttributes());
+    AltSvcMapping::ProcessHeader(mHeader, originScheme, originHost, originPort,
+                                 mCI->GetUsername(), mCI->GetPrivate(), nullptr,
+                                 mCI->ProxyInfo(), 0,
+                                 mCI->GetOriginAttributes());
     return NS_OK;
   }
 
  private:
   nsCString mHeader;
   nsCString mOrigin;
   RefPtr<nsHttpConnectionInfo> mCI;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
--- a/netwerk/protocol/http/PAltService.ipdl
+++ b/netwerk/protocol/http/PAltService.ipdl
@@ -13,27 +13,24 @@ namespace mozilla {
 namespace net {
 
 refcounted protocol PAltService
 {
   manager PSocketProcess;
 
 parent:
   async ClearHostMapping(nsCString host, int32_t port,
-                         OriginAttributes originAttributes,
-                         nsCString topWindowOrigin);
+                         OriginAttributes originAttributes);
 
   async ProcessHeader(nsCString buf,
                       nsCString originScheme,
                       nsCString originHost,
                       int32_t originPort,
                       nsCString username,
-                      nsCString topWindowOrigin,
                       bool privateBrowsing,
-                      bool isolated,
                       ProxyInfoCloneArgs[] proxyInfo,
                       uint32_t caps,
                       OriginAttributes originAttributes);
 
 child:
   async __delete__();
 };
 
--- a/netwerk/protocol/http/TRRServiceChannel.cpp
+++ b/netwerk/protocol/http/TRRServiceChannel.cpp
@@ -400,19 +400,18 @@ nsresult TRRServiceChannel::BeginConnect
                       !LoadBeConservative();
 
   RefPtr<AltSvcMapping> mapping;
   if (!mConnectionInfo && LoadAllowAltSvc() &&  // per channel
       (http2Allowed || http3Allowed) && !(mLoadFlags & LOAD_FRESH_CONNECTION) &&
       AltSvcMapping::AcceptableProxy(proxyInfo) &&
       (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) &&
       (mapping = gHttpHandler->GetAltServiceMapping(
-           scheme, host, port, mPrivateBrowsing, IsIsolated(),
-           GetTopWindowOrigin(), OriginAttributes(), http2Allowed,
-           http3Allowed))) {
+           scheme, host, port, mPrivateBrowsing, OriginAttributes(),
+           http2Allowed, http3Allowed))) {
     LOG(("TRRServiceChannel %p Alt Service Mapping Found %s://%s:%d [%s]\n",
          this, scheme.get(), mapping->AlternateHost().get(),
          mapping->AlternatePort(), mapping->HashKey().get()));
 
     if (!(mLoadFlags & LOAD_ANONYMOUS) && !mPrivateBrowsing) {
       nsAutoCString altUsedLine(mapping->AlternateHost());
       bool defaultPort =
           mapping->AlternatePort() ==
@@ -961,34 +960,31 @@ void TRRServiceChannel::ProcessAltServic
   nsCOMPtr<nsIInterfaceRequestor> callbacks;
   nsCOMPtr<nsProxyInfo> proxyInfo;
   NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup,
                                          getter_AddRefs(callbacks));
   if (mProxyInfo) {
     proxyInfo = do_QueryInterface(mProxyInfo);
   }
 
-  nsCString topWindowOrigin = GetTopWindowOrigin();
-  bool isIsolated = IsIsolated();
   auto processHeaderTask = [altSvc, scheme, originHost, originPort,
-                            userName(mUsername), topWindowOrigin,
-                            privateBrowsing(mPrivateBrowsing), isIsolated,
-                            callbacks, proxyInfo, caps(mCaps)]() {
+                            userName(mUsername),
+                            privateBrowsing(mPrivateBrowsing), callbacks,
+                            proxyInfo, caps(mCaps)]() {
     if (XRE_IsSocketProcess()) {
-      AltServiceChild::ProcessHeader(
-          altSvc, scheme, originHost, originPort, userName, topWindowOrigin,
-          privateBrowsing, isIsolated, callbacks, proxyInfo,
-          caps & NS_HTTP_DISALLOW_SPDY, OriginAttributes());
+      AltServiceChild::ProcessHeader(altSvc, scheme, originHost, originPort,
+                                     userName, privateBrowsing, callbacks,
+                                     proxyInfo, caps & NS_HTTP_DISALLOW_SPDY,
+                                     OriginAttributes());
       return;
     }
 
     AltSvcMapping::ProcessHeader(
-        altSvc, scheme, originHost, originPort, userName, topWindowOrigin,
-        privateBrowsing, isIsolated, callbacks, proxyInfo,
-        caps & NS_HTTP_DISALLOW_SPDY, OriginAttributes());
+        altSvc, scheme, originHost, originPort, userName, privateBrowsing,
+        callbacks, proxyInfo, caps & NS_HTTP_DISALLOW_SPDY, OriginAttributes());
   };
 
   if (NS_IsMainThread()) {
     processHeaderTask();
     return;
   }
 
   NS_DispatchToMainThread(NS_NewRunnableFunction(
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2088,19 +2088,18 @@ void nsHttpChannel::ProcessAltService() 
     StoragePrincipalHelper::GetOriginAttributes(
         this, originAttributes, StoragePrincipalHelper::eRegularPrincipal);
   } else {
     StoragePrincipalHelper::GetOriginAttributesForNetworkState(
         this, originAttributes);
   }
 
   AltSvcMapping::ProcessHeader(
-      altSvc, scheme, originHost, originPort, mUsername, GetTopWindowOrigin(),
-      mPrivateBrowsing, IsIsolated(), callbacks, proxyInfo,
-      mCaps & NS_HTTP_DISALLOW_SPDY, originAttributes);
+      altSvc, scheme, originHost, originPort, mUsername, mPrivateBrowsing,
+      callbacks, proxyInfo, mCaps & NS_HTTP_DISALLOW_SPDY, originAttributes);
 }
 
 nsresult nsHttpChannel::ProcessResponse() {
   uint32_t httpStatus = mResponseHead->Status();
 
   LOG(("nsHttpChannel::ProcessResponse [this=%p httpStatus=%u]\n", this,
        httpStatus));
 
@@ -6564,18 +6563,17 @@ nsresult nsHttpChannel::BeginConnect() {
   // Adjust mCaps according to our request headers:
   //  - If "Connection: close" is set as a request header, then do not bother
   //    trying to establish a keep-alive connection.
   if (mRequestHead.HasHeaderValue(nsHttp::Connection, "close")) {
     mCaps &= ~(NS_HTTP_ALLOW_KEEPALIVE);
     StoreAllowHttp3(false);
   }
 
-  gHttpHandler->MaybeAddAltSvcForTesting(mURI, mUsername, GetTopWindowOrigin(),
-                                         mPrivateBrowsing, IsIsolated(),
+  gHttpHandler->MaybeAddAltSvcForTesting(mURI, mUsername, mPrivateBrowsing,
                                          mCallbacks, originAttributes);
 
   RefPtr<nsHttpConnectionInfo> connInfo = new nsHttpConnectionInfo(
       host, port, ""_ns, mUsername, proxyInfo, originAttributes, isHttps);
   bool http2Allowed = !gHttpHandler->IsHttp2Excluded(connInfo);
   if (!LoadAllowHttp3()) {
     mCaps |= NS_HTTP_DISALLOW_HTTP3;
   }
@@ -6589,18 +6587,17 @@ nsresult nsHttpChannel::BeginConnect() {
                    mHTTPSSVCRecord.isNothing());
 
   RefPtr<AltSvcMapping> mapping;
   if (!mConnectionInfo && LoadAllowAltSvc() &&  // per channel
       (http2Allowed || http3Allowed) && !(mLoadFlags & LOAD_FRESH_CONNECTION) &&
       AltSvcMapping::AcceptableProxy(proxyInfo) &&
       (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) &&
       (mapping = gHttpHandler->GetAltServiceMapping(
-           scheme, host, port, mPrivateBrowsing, IsIsolated(),
-           GetTopWindowOrigin(), originAttributes, http2Allowed,
+           scheme, host, port, mPrivateBrowsing, originAttributes, http2Allowed,
            http3Allowed))) {
     LOG(("nsHttpChannel %p Alt Service Mapping Found %s://%s:%d [%s]\n", this,
          scheme.get(), mapping->AlternateHost().get(), mapping->AlternatePort(),
          mapping->HashKey().get()));
 
     if (!(mLoadFlags & LOAD_ANONYMOUS) && !mPrivateBrowsing) {
       nsAutoCString altUsedLine(mapping->AlternateHost());
       bool defaultPort =
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -2996,18 +2996,17 @@ void nsHttpHandler::SetHttpHandlerInitAr
 }
 
 void nsHttpHandler::SetDeviceModelId(const nsCString& aModelId) {
   MOZ_ASSERT(XRE_IsSocketProcess());
   mDeviceModelId = aModelId;
 }
 
 void nsHttpHandler::MaybeAddAltSvcForTesting(
-    nsIURI* aUri, const nsACString& aUsername,
-    const nsACString& aTopWindowOrigin, bool aPrivateBrowsing, bool aIsolated,
+    nsIURI* aUri, const nsACString& aUsername, bool aPrivateBrowsing,
     nsIInterfaceRequestor* aCallbacks,
     const OriginAttributes& aOriginAttributes) {
   if (!IsHttp3Enabled() || mAltSvcMappingTemptativeMap.IsEmpty()) {
     return;
   }
 
   bool isHttps = false;
   if (NS_FAILED(aUri->SchemeIs("https", &isHttps)) || !isHttps) {
@@ -3021,20 +3020,19 @@ void nsHttpHandler::MaybeAddAltSvcForTes
   }
 
   nsCString* map = mAltSvcMappingTemptativeMap.Get(originHost);
   if (map) {
     int32_t originPort = 80;
     aUri->GetPort(&originPort);
     LOG(("nsHttpHandler::MaybeAddAltSvcForTesting for %s map: %s",
          originHost.get(), PromiseFlatCString(*map).get()));
-    AltSvcMapping::ProcessHeader(*map, nsCString("https"), originHost,
-                                 originPort, aUsername, aTopWindowOrigin,
-                                 aPrivateBrowsing, aIsolated, aCallbacks,
-                                 nullptr, 0, aOriginAttributes, true);
+    AltSvcMapping::ProcessHeader(
+        *map, nsCString("https"), originHost, originPort, aUsername,
+        aPrivateBrowsing, aCallbacks, nullptr, 0, aOriginAttributes, true);
   }
 }
 
 bool nsHttpHandler::UseHTTPSRRAsAltSvcEnabled() const {
   return StaticPrefs::network_dns_use_https_rr_as_altsvc();
 }
 
 bool nsHttpHandler::EchConfigEnabled() const {
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -359,22 +359,20 @@ class nsHttpHandler final : public nsIHt
       nsIInterfaceRequestor* callbacks, uint32_t caps,
       const OriginAttributes& originAttributes) {
     mAltSvcCache->UpdateAltServiceMappingWithoutValidation(
         map, proxyInfo, callbacks, caps, originAttributes);
   }
 
   already_AddRefed<AltSvcMapping> GetAltServiceMapping(
       const nsACString& scheme, const nsACString& host, int32_t port, bool pb,
-      bool isolated, const nsACString& topWindowOrigin,
       const OriginAttributes& originAttributes, bool aHttp2Allowed,
       bool aHttp3Allowed) {
-    return mAltSvcCache->GetAltServiceMapping(scheme, host, port, pb, isolated,
-                                              topWindowOrigin, originAttributes,
-                                              aHttp2Allowed, aHttp3Allowed);
+    return mAltSvcCache->GetAltServiceMapping(
+        scheme, host, port, pb, originAttributes, aHttp2Allowed, aHttp3Allowed);
   }
 
   //
   // The HTTP handler caches pointers to specific XPCOM services, and
   // provides the following helper routines for accessing those services:
   //
   [[nodiscard]] nsresult GetStreamConverterService(nsIStreamConverterService**);
   [[nodiscard]] nsresult GetIOService(nsIIOService** service);
@@ -505,18 +503,17 @@ class nsHttpHandler final : public nsIHt
 
   nsresult CompleteUpgrade(HttpTransactionShell* aTrans,
                            nsIHttpUpgradeListener* aUpgradeListener);
 
   nsresult DoShiftReloadConnectionCleanupWithConnInfo(
       nsHttpConnectionInfo* aCI);
 
   void MaybeAddAltSvcForTesting(nsIURI* aUri, const nsACString& aUsername,
-                                const nsACString& aTopWindowOrigin,
-                                bool aPrivateBrowsing, bool aIsolated,
+                                bool aPrivateBrowsing,
                                 nsIInterfaceRequestor* aCallbacks,
                                 const OriginAttributes& aOriginAttributes);
 
   bool UseHTTPSRRAsAltSvcEnabled() const;
 
   bool EchConfigEnabled() const;
   // When EchConfig is enabled and all records with echConfig are failed, this
   // functon indicate whether we can fallback to the origin server.