summaryrefslogtreecommitdiffstats
path: root/netwerk/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/ipc')
-rw-r--r--netwerk/ipc/DocumentLoadListener.cpp18
-rw-r--r--netwerk/ipc/DocumentLoadListener.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp
index 32d7036ff1..a133df4663 100644
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -810,6 +810,24 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
if (cos && aUrgentStart) {
cos->AddClassFlags(nsIClassOfService::UrgentStart);
}
+
+ // ClientChannelHelper below needs us to have finalized the principal for
+ // the channel because it will request that StoragePrincipalHelper mint us a
+ // principal that needs to match the same principal that a later call to
+ // StoragePrincipalHelper will mint when determining the right origin to
+ // look up the ServiceWorker.
+ //
+ // Because nsHttpChannel::AsyncOpen calls UpdateAntiTrackingInfoForChannel
+ // which potentially flips the third party bit/flag on the partition key on
+ // the cookie jar which impacts the principal that will be minted, it is
+ // essential that UpdateAntiTrackingInfoForChannel is called before
+ // AddClientChannelHelperInParent below.
+ //
+ // Because the call to UpdateAntiTrackingInfoForChannel is largely
+ // idempotent, we currently just make the call ourselves right now. The one
+ // caveat is that the RFPRandomKey may be spuriously regenerated for
+ // top-level documents.
+ AntiTrackingUtils::UpdateAntiTrackingInfoForChannel(httpChannel);
}
// Setup a ClientChannelHelper to watch for redirects, and copy
diff --git a/netwerk/ipc/DocumentLoadListener.h b/netwerk/ipc/DocumentLoadListener.h
index a8e4ffa7ab..6f6ad357ae 100644
--- a/netwerk/ipc/DocumentLoadListener.h
+++ b/netwerk/ipc/DocumentLoadListener.h
@@ -603,7 +603,7 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
RefPtr<dom::ContentParent> mContentParent;
void RejectOpenPromise(nsresult aStatus, nsresult aLoadGroupStatus,
- bool aContinueNavigating, const char* aLocation) {
+ bool aContinueNavigating, StaticString aLocation) {
// It is possible for mOpenPromise to not be set if AsyncOpen failed and
// the DocumentChannel got canceled.
if (!mOpenPromiseResolved && mOpenPromise) {