diff --git a/dom/base/nsContentPolicyUtils.h b/dom/base/nsContentPolicyUtils.h index 9fc96eb1ac3d..1256efe91bd3 100644 --- a/dom/base/nsContentPolicyUtils.h +++ b/dom/base/nsContentPolicyUtils.h @@ -147,7 +147,6 @@ inline const char* NS_CP_ContentTypeName(nsContentPolicyType contentType) { CASE_RETURN(TYPE_INTERNAL_WORKER_STATIC_MODULE); CASE_RETURN(TYPE_PROXIED_WEBRTC_MEDIA); CASE_RETURN(TYPE_WEB_IDENTITY); - CASE_RETURN(TYPE_WEB_TRANSPORT); CASE_RETURN(TYPE_END); case nsIContentPolicy::TYPE_INVALID: break; diff --git a/dom/base/nsIContentPolicy.idl b/dom/base/nsIContentPolicy.idl index 93baafc5832a..283705a9d08a 100644 --- a/dom/base/nsIContentPolicy.idl +++ b/dom/base/nsIContentPolicy.idl @@ -438,18 +438,13 @@ interface nsIContentPolicy : nsISupports */ TYPE_INTERNAL_WORKER_STATIC_MODULE = 58, - /** - * Indicates Webtransport request - */ - TYPE_WEB_TRANSPORT = 59, - /** * Used to indicate the end of this list, not a content policy. If you want * to add a new content policy type, place it before this sentinel value * TYPE_END, have it use TYPE_END's current value, and increment TYPE_END by * one. (TYPE_END should always have the highest numerical value.) */ - TYPE_END = 60, + TYPE_END = 59, /* When adding new content types, please update diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp index 234b4098858c..158073eca1d0 100644 --- a/dom/cache/DBSchema.cpp +++ b/dom/cache/DBSchema.cpp @@ -344,8 +344,7 @@ static_assert( nsIContentPolicy::TYPE_UA_FONT == 55 && nsIContentPolicy::TYPE_WEB_IDENTITY == 57 && nsIContentPolicy::TYPE_INTERNAL_WORKER_STATIC_MODULE == 58 && - nsIContentPolicy::TYPE_WEB_TRANSPORT == 59 && - nsIContentPolicy::TYPE_END == 60, + nsIContentPolicy::TYPE_END == 59, "nsContentPolicyType values are as expected"); namespace { diff --git a/dom/fetch/InternalRequest.cpp b/dom/fetch/InternalRequest.cpp index 41797d3e8214..fbb261fff904 100644 --- a/dom/fetch/InternalRequest.cpp +++ b/dom/fetch/InternalRequest.cpp @@ -347,8 +347,6 @@ RequestDestination InternalRequest::MapContentPolicyTypeToRequestDestination( return RequestDestination::_empty; case nsIContentPolicy::TYPE_WEB_IDENTITY: return RequestDestination::_empty; - case nsIContentPolicy::TYPE_WEB_TRANSPORT: - return RequestDestination::_empty; case nsIContentPolicy::TYPE_INVALID: case nsIContentPolicy::TYPE_END: break; diff --git a/dom/security/SecFetch.cpp b/dom/security/SecFetch.cpp index 591ea3b21c52..5e8572972231 100644 --- a/dom/security/SecFetch.cpp +++ b/dom/security/SecFetch.cpp @@ -109,8 +109,6 @@ nsCString MapInternalContentPolicyTypeToDest(nsContentPolicyType aType) { return "empty"_ns; case nsIContentPolicy::TYPE_WEB_IDENTITY: return "webidentity"_ns; - case nsIContentPolicy::TYPE_WEB_TRANSPORT: - return "webtransport"_ns; case nsIContentPolicy::TYPE_END: case nsIContentPolicy::TYPE_INVALID: break; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp index 2bc6c66de3e4..5f9156ce2e70 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -323,7 +323,6 @@ CSPDirective CSP_ContentTypeToDirective(nsContentPolicyType aType) { case nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE: case nsIContentPolicy::TYPE_INTERNAL_FETCH_PRELOAD: case nsIContentPolicy::TYPE_WEB_IDENTITY: - case nsIContentPolicy::TYPE_WEB_TRANSPORT: return nsIContentSecurityPolicy::CONNECT_SRC_DIRECTIVE; case nsIContentPolicy::TYPE_OBJECT: diff --git a/dom/webtransport/api/WebTransport.cpp b/dom/webtransport/api/WebTransport.cpp index 1c269a7880fb..40b69bb88e14 100644 --- a/dom/webtransport/api/WebTransport.cpp +++ b/dom/webtransport/api/WebTransport.cpp @@ -244,11 +244,6 @@ void WebTransport::Init(const GlobalObject& aGlobal, const nsAString& aURL, } nsCOMPtr principal = mGlobal->PrincipalOrNull(); - mozilla::Maybe ipcClientInfo; - - if (mGlobal->GetClientInfo().isSome()) { - ipcClientInfo = mozilla::Some(mGlobal->GetClientInfo().ref().ToIPC()); - } // Create a new IPC connection Endpoint parentEndpoint; Endpoint childEndpoint; @@ -326,7 +321,7 @@ void WebTransport::Init(const GlobalObject& aGlobal, const nsAString& aURL, // https://w3c.github.io/webtransport/#webtransport-constructor Spec 5.2 backgroundChild - ->SendCreateWebTransportParent(aURL, principal, ipcClientInfo, dedicated, + ->SendCreateWebTransportParent(aURL, principal, dedicated, requireUnreliable, (uint32_t)congestionControl, // XXX serverCertHashes, diff --git a/dom/webtransport/parent/WebTransportParent.cpp b/dom/webtransport/parent/WebTransportParent.cpp index ca045d4136e6..0831bc1dbd21 100644 --- a/dom/webtransport/parent/WebTransportParent.cpp +++ b/dom/webtransport/parent/WebTransportParent.cpp @@ -9,7 +9,6 @@ #include "mozilla/StaticPrefs_network.h" #include "mozilla/TimeStamp.h" #include "mozilla/Unused.h" -#include "mozilla/dom/ClientInfo.h" #include "mozilla/dom/WebTransportBinding.h" #include "mozilla/dom/WebTransportLog.h" #include "mozilla/ipc/BackgroundParent.h" @@ -33,8 +32,7 @@ WebTransportParent::~WebTransportParent() { } void WebTransportParent::Create( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const mozilla::Maybe& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence* aServerCertHashes, Endpoint&& aParentEndpoint, @@ -90,11 +88,10 @@ void WebTransportParent::Create( "WebTransport AsyncConnect", [self = RefPtr{this}, uri = std::move(uri), principal = RefPtr{aPrincipal}, - flags = nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL, - aClientInfo] { + flags = nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL] { LOG(("WebTransport %p AsyncConnect", self.get())); - if (NS_FAILED(self->mWebTransport->AsyncConnectWithClient( - uri, principal, flags, self, aClientInfo))) { + if (NS_FAILED(self->mWebTransport->AsyncConnect(uri, principal, flags, + self))) { LOG(("AsyncConnect failure; we should get OnSessionClosed")); } }); diff --git a/dom/webtransport/parent/WebTransportParent.h b/dom/webtransport/parent/WebTransportParent.h index 8a24d5ac7fb7..782c353d7cb1 100644 --- a/dom/webtransport/parent/WebTransportParent.h +++ b/dom/webtransport/parent/WebTransportParent.h @@ -8,7 +8,6 @@ #define DOM_WEBTRANSPORT_PARENT_WEBTRANSPORTPARENT_H_ #include "ErrorList.h" -#include "mozilla/dom/ClientIPCTypes.h" #include "mozilla/dom/FlippedOnce.h" #include "mozilla/dom/PWebTransportParent.h" #include "mozilla/ipc/Endpoint.h" @@ -32,7 +31,6 @@ class WebTransportParent : public PWebTransportParent, NS_DECL_WEBTRANSPORTSESSIONEVENTLISTENER void Create(const nsAString& aURL, nsIPrincipal* aPrincipal, - const mozilla::Maybe& aClientInfo, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence* aServerCertHashes, diff --git a/ipc/glue/BackgroundParentImpl.cpp b/ipc/glue/BackgroundParentImpl.cpp index 62f84f6a1fec..ef92649684e3 100644 --- a/ipc/glue/BackgroundParentImpl.cpp +++ b/ipc/glue/BackgroundParentImpl.cpp @@ -490,8 +490,7 @@ mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateFileSystemManagerParent( } mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateWebTransportParent( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const mozilla::Maybe& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence* aServerCertHashes, Endpoint&& aParentEndpoint, @@ -501,10 +500,9 @@ mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateWebTransportParent( RefPtr webt = new mozilla::dom::WebTransportParent(); - webt->Create(aURL, aPrincipal, aClientInfo, aDedicated, aRequireUnreliable, - aCongestionControl, - /*aServerCertHashes, */ std::move(aParentEndpoint), - std::move(aResolver)); + webt->Create( + aURL, aPrincipal, aDedicated, aRequireUnreliable, aCongestionControl, + /*aServerCertHashes, */ std::move(aParentEndpoint), std::move(aResolver)); return IPC_OK(); } diff --git a/ipc/glue/BackgroundParentImpl.h b/ipc/glue/BackgroundParentImpl.h index 50c1607e8698..c6806271459b 100644 --- a/ipc/glue/BackgroundParentImpl.h +++ b/ipc/glue/BackgroundParentImpl.h @@ -136,8 +136,7 @@ class BackgroundParentImpl : public PBackgroundParent { CreateFileSystemManagerParentResolver&& aResolver) override; mozilla::ipc::IPCResult RecvCreateWebTransportParent( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const mozilla::Maybe& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence* aServerCertHashes, Endpoint&& aParentEndpoint, diff --git a/ipc/glue/PBackground.ipdl b/ipc/glue/PBackground.ipdl index b242bd13eab1..388e262340c5 100644 --- a/ipc/glue/PBackground.ipdl +++ b/ipc/glue/PBackground.ipdl @@ -55,7 +55,6 @@ include protocol PWebSocketConnection; include protocol PWebTransport; include protocol PFetch; -include ClientIPCTypes; include DOMTypes; include IPCBlob; include IPCServiceWorkerDescriptor; @@ -196,7 +195,6 @@ parent: async CreateWebTransportParent( nsString aURL, nullable nsIPrincipal aPrincipal, - IPCClientInfo? aClientInfo, bool aDedicated, bool aRequireUnreliable, uint32_t aCongestionControl, diff --git a/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp b/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp index bcbf00f56e84..edf67a6e70eb 100644 --- a/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp +++ b/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp @@ -62,14 +62,6 @@ WebTransportSessionProxy::~WebTransportSessionProxy() { nsresult WebTransportSessionProxy::AsyncConnect( nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aSecurityFlags, WebTransportSessionEventListener* aListener) { - return AsyncConnectWithClient(aURI, aPrincipal, aSecurityFlags, aListener, - Maybe()); -} - -nsresult WebTransportSessionProxy::AsyncConnectWithClient( - nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aSecurityFlags, - WebTransportSessionEventListener* aListener, - const Maybe& aClientInfo) { MOZ_ASSERT(NS_IsMainThread()); LOG(("WebTransportSessionProxy::AsyncConnect")); @@ -89,24 +81,12 @@ nsresult WebTransportSessionProxy::AsyncConnectWithClient( nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL | nsIRequest::LOAD_BYPASS_CACHE | nsIRequest::INHIBIT_CACHING; - nsresult rv = NS_ERROR_FAILURE; - - if (aClientInfo.isSome()) { - rv = NS_NewChannel(getter_AddRefs(mChannel), aURI, aPrincipal, - aClientInfo.ref(), Maybe(), - flags, nsContentPolicyType::TYPE_WEB_TRANSPORT, - /* aCookieJarSettings */ nullptr, - /* aPerformanceStorage */ nullptr, - /* aLoadGroup */ nullptr, - /* aCallbacks */ this, loadFlags); - } else { - rv = NS_NewChannel(getter_AddRefs(mChannel), aURI, aPrincipal, flags, - nsContentPolicyType::TYPE_WEB_TRANSPORT, - /* aCookieJarSettings */ nullptr, - /* aPerformanceStorage */ nullptr, - /* aLoadGroup */ nullptr, - /* aCallbacks */ this, loadFlags); - } + nsresult rv = NS_NewChannel(getter_AddRefs(mChannel), aURI, aPrincipal, flags, + nsContentPolicyType::TYPE_OTHER, + /* aCookieJarSettings */ nullptr, + /* aPerformanceStorage */ nullptr, + /* aLoadGroup */ nullptr, + /* aCallbacks */ this, loadFlags); NS_ENSURE_SUCCESS(rv, rv); diff --git a/netwerk/protocol/webtransport/nsIWebTransport.idl b/netwerk/protocol/webtransport/nsIWebTransport.idl index baa01818d714..d6b260266d45 100644 --- a/netwerk/protocol/webtransport/nsIWebTransport.idl +++ b/netwerk/protocol/webtransport/nsIWebTransport.idl @@ -14,9 +14,6 @@ interface nsIWebTransportSendStream; interface nsIWebTransportReceiveStream; %{C++ -namespace mozilla::dom { -class ClientInfo; -} namespace mozilla::net { class Http3WebTransportSession; class Http3WebTransportStream; @@ -26,7 +23,6 @@ class Http3WebTransportStream; [ptr] native Http3WebTransportSessionPtr(mozilla::net::Http3WebTransportSession); [ptr] native Http3WebTransportStreamPtr(mozilla::net::Http3WebTransportStream); native Datagram(nsTArray&&); -[ref] native const_MaybeClientInfoRef(const mozilla::Maybe); [builtinclass, scriptable, uuid(c20d6e77-8cb1-4838-a88d-fff826080aa3)] interface nsIWebTransport : nsISupports { @@ -40,13 +36,6 @@ interface nsIWebTransport : nsISupports { in nsIPrincipal aLoadingPrincipal, in unsigned long aSecurityFlags, in WebTransportSessionEventListener aListener); - - void asyncConnectWithClient(in nsIURI aURI, - in nsIPrincipal aLoadingPrincipal, - in unsigned long aSecurityFlags, - in WebTransportSessionEventListener aListener, - in const_MaybeClientInfoRef aClientInfo); - // Asynchronously get states. void getStats();