commit 65b98c7a2cc2b785e06071316ae45f50b64c0757
parent 0525ddc78e807bb1fed92e00b31375797025aac2
Author: agoloman <agoloman@mozilla.com>
Date: Mon, 20 Oct 2025 22:15:57 +0300
Revert "Bug 1967266 - Pass clientinfo when we create a loadinfo for websocket. r=necko-reviewers,valentin" for causing wpt failures @dedicatedworker-report-only.html.
This reverts commit 86bb6dbee83d2386ae66bc869cf92be98f52b146.
Diffstat:
4 files changed, 13 insertions(+), 29 deletions(-)
diff --git a/dom/websocket/WebSocket.cpp b/dom/websocket/WebSocket.cpp
@@ -273,7 +273,6 @@ class WebSocketImpl final : public nsIInterfaceRequestor,
RefPtr<WebSocketEventService> mService;
nsCOMPtr<nsIPrincipal> mLoadingPrincipal;
- Maybe<ClientInfo> mClientInfo;
RefPtr<WebSocketImplProxy> mImplProxy;
@@ -1670,7 +1669,6 @@ nsresult WebSocketImpl::Init(nsIGlobalObject* aWindowGlobal, JSContext* aCx,
}
mIsServerSide = aIsServerSide;
- mClientInfo = aClientInfo;
// If we don't have aCx, we are window-less, so we don't have a
// inner-windowID. This can happen in sharedWorkers and ServiceWorkers or in
@@ -1936,7 +1934,7 @@ nsresult WebSocketImpl::InitializeConnection(
doc, doc ? doc->NodePrincipal() : aPrincipal, aPrincipal,
aCookieJarSettings,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL,
- nsIContentPolicy::TYPE_WEBSOCKET, mClientInfo, 0);
+ nsIContentPolicy::TYPE_WEBSOCKET, 0);
MOZ_ASSERT(NS_SUCCEEDED(rv));
if (!mRequestedProtocolList.IsEmpty()) {
diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -221,13 +221,10 @@ BaseWebSocketChannel::InitLoadInfoNative(
nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
nsIPrincipal* aTriggeringPrincipal,
nsICookieJarSettings* aCookieJarSettings, uint32_t aSecurityFlags,
- nsContentPolicyType aContentPolicyType,
- const Maybe<mozilla::dom::ClientInfo>& aClientInfo,
- uint32_t aSandboxFlags) {
- MOZ_ASSERT(NS_IsMainThread());
+ nsContentPolicyType aContentPolicyType, uint32_t aSandboxFlags) {
mLoadInfo = MOZ_TRY(LoadInfo::Create(
aLoadingPrincipal, aTriggeringPrincipal, aLoadingNode, aSecurityFlags,
- aContentPolicyType, aClientInfo,
+ aContentPolicyType, Maybe<mozilla::dom::ClientInfo>(),
Maybe<mozilla::dom::ServiceWorkerDescriptor>(), aSandboxFlags));
if (aCookieJarSettings) {
mLoadInfo->SetCookieJarSettings(aCookieJarSettings);
@@ -252,9 +249,9 @@ BaseWebSocketChannel::InitLoadInfo(nsINode* aLoadingNode,
nsIPrincipal* aTriggeringPrincipal,
uint32_t aSecurityFlags,
nsContentPolicyType aContentPolicyType) {
- return InitLoadInfoNative(
- aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, nullptr,
- aSecurityFlags, aContentPolicyType, Maybe<mozilla::dom::ClientInfo>(), 0);
+ return InitLoadInfoNative(aLoadingNode, aLoadingPrincipal,
+ aTriggeringPrincipal, nullptr, aSecurityFlags,
+ aContentPolicyType, 0);
}
NS_IMETHODIMP
diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.h b/netwerk/protocol/websocket/BaseWebSocketChannel.h
@@ -54,13 +54,13 @@ class BaseWebSocketChannel : public nsIWebSocketChannel,
NS_IMETHOD SetPingInterval(uint32_t aSeconds) override;
NS_IMETHOD GetPingTimeout(uint32_t* aSeconds) override;
NS_IMETHOD SetPingTimeout(uint32_t aSeconds) override;
- NS_IMETHOD InitLoadInfoNative(
- nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
- nsIPrincipal* aTriggeringPrincipal,
- nsICookieJarSettings* aCookieJarSettings, uint32_t aSecurityFlags,
- nsContentPolicyType aContentPolicyType,
- const Maybe<mozilla::dom::ClientInfo>& aClientInfo,
- uint32_t aSandboxFlags) override;
+ NS_IMETHOD InitLoadInfoNative(nsINode* aLoadingNode,
+ nsIPrincipal* aLoadingPrincipal,
+ nsIPrincipal* aTriggeringPrincipal,
+ nsICookieJarSettings* aCookieJarSettings,
+ uint32_t aSecurityFlags,
+ nsContentPolicyType aContentPolicyType,
+ uint32_t aSandboxFlags) override;
NS_IMETHOD InitLoadInfo(nsINode* aLoadingNode,
nsIPrincipal* aLoadingPrincipal,
nsIPrincipal* aTriggeringPrincipal,
diff --git a/netwerk/protocol/websocket/nsIWebSocketChannel.idl b/netwerk/protocol/websocket/nsIWebSocketChannel.idl
@@ -20,18 +20,9 @@ webidl Node;
#include "nsISupports.idl"
#include "nsIContentPolicy.idl"
-%{C++
-#include "mozilla/Maybe.h"
-
-namespace mozilla::dom {
-class ClientInfo;
-}
-using mozilla::Maybe;
-%}
[ref] native OriginAttributes(const mozilla::OriginAttributes);
-[ref] native MaybeClientInfo(const Maybe<mozilla::dom::ClientInfo>);
/**
* Low-level websocket API: handles network protocol.
@@ -101,7 +92,6 @@ interface nsIWebSocketChannel : nsISupports
* @param aCookieJarSettings
* @param aSecurityFlags
* @param aContentPolicyType
- * @param aClientInfo
* These will be used as values for the nsILoadInfo object on the
* created channel. For details, see nsILoadInfo in nsILoadInfo.idl
* @return reference to the new nsIChannel object
@@ -119,7 +109,6 @@ interface nsIWebSocketChannel : nsISupports
in nsICookieJarSettings aCookieJarSettings,
in unsigned long aSecurityFlags,
in nsContentPolicyType aContentPolicyType,
- in MaybeClientInfo aClientInfo,
in unsigned long aSandboxFlags);
/**