author | Sandor Molnar <smolnar@mozilla.com> |
Tue, 28 Mar 2023 05:30:53 +0300 (2023-03-28) | |
changeset 658112 | 21d9932ce23f145da9c942112f607ffbec7745b9 |
parent 658111 | db2b968157d672a3bf4bc004886026834736f8a1 |
child 658113 | cb747ffc3380037048829bb331234a63cb4b3771 |
push id | 181228 |
push user | smolnar@mozilla.com |
push date | Tue, 28 Mar 2023 02:40:20 +0000 (2023-03-28) |
treeherder | autoland@21d9932ce23f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1816918 |
milestone | 113.0a1 |
backs out | db2b968157d672a3bf4bc004886026834736f8a1 |
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
|
--- a/dom/base/nsContentPolicyUtils.h +++ b/dom/base/nsContentPolicyUtils.h @@ -142,17 +142,16 @@ inline const char* NS_CP_ContentTypeName CASE_RETURN(TYPE_INTERNAL_FONT_PRELOAD); CASE_RETURN(TYPE_INTERNAL_CHROMEUTILS_COMPILED_SCRIPT); CASE_RETURN(TYPE_INTERNAL_FRAME_MESSAGEMANAGER_SCRIPT); CASE_RETURN(TYPE_INTERNAL_FETCH_PRELOAD); CASE_RETURN(TYPE_UA_FONT); 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; // Do not add default: so that compilers can catch the missing case. } return "<Unknown Type>"; }
--- a/dom/base/nsIContentPolicy.idl +++ b/dom/base/nsIContentPolicy.idl @@ -434,27 +434,22 @@ interface nsIContentPolicy : nsISupports TYPE_WEB_IDENTITY = 57, /** * Indicates the load of a static module on workers. */ 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 * NS_CP_ContentTypeName, nsCSPContext, CSP_ContentTypeToDirective, * DoContentSecurityChecks, all nsIContentPolicy implementations, the * static_assert in dom/cache/DBSchema.cpp, ChannelWrapper.webidl, * ChannelWrapper.cpp, PermissionManager.cpp, * IPCMessageUtilsSpecializations.h, and other things that are not
--- a/dom/cache/DBSchema.cpp +++ b/dom/cache/DBSchema.cpp @@ -339,18 +339,17 @@ static_assert( nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET == 50 && nsIContentPolicy::TYPE_INTERNAL_FONT_PRELOAD == 51 && nsIContentPolicy::TYPE_INTERNAL_CHROMEUTILS_COMPILED_SCRIPT == 52 && nsIContentPolicy::TYPE_INTERNAL_FRAME_MESSAGEMANAGER_SCRIPT == 53 && nsIContentPolicy::TYPE_INTERNAL_FETCH_PRELOAD == 54 && 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 { using EntryId = int32_t; struct IdCount { explicit IdCount(int32_t aId) : mId(aId), mCount(1) {}
--- a/dom/fetch/InternalRequest.cpp +++ b/dom/fetch/InternalRequest.cpp @@ -342,18 +342,16 @@ RequestDestination InternalRequest::MapC case nsIContentPolicy::TYPE_INTERNAL_AUDIOWORKLET: return RequestDestination::Audioworklet; case nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET: return RequestDestination::Paintworklet; case nsIContentPolicy::TYPE_PROXIED_WEBRTC_MEDIA: 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; // Do not add default: so that compilers can catch the missing case. } MOZ_ASSERT(false, "Unhandled nsContentPolicyType value"); return RequestDestination::_empty;
--- a/dom/security/SecFetch.cpp +++ b/dom/security/SecFetch.cpp @@ -104,18 +104,16 @@ nsCString MapInternalContentPolicyTypeTo case nsIContentPolicy::TYPE_SAVEAS_DOWNLOAD: return "empty"_ns; case nsIContentPolicy::TYPE_SPECULATIVE: return "empty"_ns; case nsIContentPolicy::TYPE_PROXIED_WEBRTC_MEDIA: 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; // Do not add default: so that compilers can catch the missing case. } MOZ_CRASH("Unhandled nsContentPolicyType value"); }
--- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -318,17 +318,16 @@ CSPDirective CSP_ContentTypeToDirective( case nsIContentPolicy::TYPE_XMLHTTPREQUEST: case nsIContentPolicy::TYPE_BEACON: case nsIContentPolicy::TYPE_PING: case nsIContentPolicy::TYPE_FETCH: case nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST: 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: case nsIContentPolicy::TYPE_OBJECT_SUBREQUEST: case nsIContentPolicy::TYPE_INTERNAL_EMBED: case nsIContentPolicy::TYPE_INTERNAL_OBJECT: return nsIContentSecurityPolicy::OBJECT_SRC_DIRECTIVE;
--- a/dom/webtransport/api/WebTransport.cpp +++ b/dom/webtransport/api/WebTransport.cpp @@ -239,17 +239,16 @@ void WebTransport::Init(const GlobalObje PBackgroundChild* backgroundChild = BackgroundChild::GetOrCreateForCurrentThread(); if (NS_WARN_IF(!backgroundChild)) { return; } nsCOMPtr<nsIPrincipal> principal = mGlobal->PrincipalOrNull(); - IPCClientInfo ipcClientInfo(mGlobal->GetClientInfo().ref().ToIPC()); // Create a new IPC connection Endpoint<PWebTransportParent> parentEndpoint; Endpoint<PWebTransportChild> childEndpoint; MOZ_ALWAYS_SUCCEEDS( PWebTransport::CreateEndpoints(&parentEndpoint, &childEndpoint)); RefPtr<WebTransportChild> child = new WebTransportChild(this); if (NS_IsMainThread()) { @@ -317,17 +316,17 @@ void WebTransport::Init(const GlobalObje // Step 24: Initialize WebTransport over HTTP with transport, parsedURL, // dedicated, requireUnreliable, and congestionControl. LOG(("Connecting WebTransport to parent for %s", NS_ConvertUTF16toUTF8(aURL).get())); // 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, std::move(parentEndpoint)) ->Then(GetCurrentSerialEventTarget(), __func__, [self = RefPtr{this}, child](PBackgroundChild::CreateWebTransportParentPromise:: ResolveOrRejectValue&& aResult) {
--- a/dom/webtransport/parent/WebTransportParent.cpp +++ b/dom/webtransport/parent/WebTransportParent.cpp @@ -27,18 +27,17 @@ NS_IMPL_ISUPPORTS(WebTransportParent, We using CreateWebTransportPromise = MozPromise<WebTransportReliabilityMode, nsresult, true>; WebTransportParent::~WebTransportParent() { LOG(("Destroying WebTransportParent %p", this)); } void WebTransportParent::Create( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const IPCClientInfo& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence<WebTransportHash>* aServerCertHashes, Endpoint<PWebTransportParent>&& aParentEndpoint, std::function<void(std::tuple<const nsresult&, const uint8_t&>)>&& aResolver) { LOG(("Created WebTransportParent %p %s %s %s congestion=%s", this, NS_ConvertUTF16toUTF8(aURL).get(), aDedicated ? "Dedicated" : "AllowPooling", @@ -84,22 +83,20 @@ void WebTransportParent::Create( static_cast<uint8_t>(WebTransportReliabilityMode::Pending))); return; } nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction( "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, - mozilla::Some(ClientInfo(aClientInfo))))) { + if (NS_FAILED(self->mWebTransport->AsyncConnect(uri, principal, flags, + self))) { LOG(("AsyncConnect failure; we should get OnSessionClosed")); } }); // Bind to SocketThread for IPC - connection creation/destruction must // hit MainThread, but keep all other traffic on SocketThread. Note that // we must call aResolver() on this (PBackground) thread. mSocketThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
--- a/dom/webtransport/parent/WebTransportParent.h +++ b/dom/webtransport/parent/WebTransportParent.h @@ -3,17 +3,16 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef DOM_WEBTRANSPORT_PARENT_WEBTRANSPORTPARENT_H_ #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" #include "mozilla/ipc/PBackgroundSharedTypes.h" #include "nsISupports.h" #include "nsIPrincipal.h" #include "nsIWebTransport.h" @@ -27,18 +26,17 @@ class WebTransportParent : public PWebTr public: WebTransportParent() = default; NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_WEBTRANSPORTSESSIONEVENTLISTENER void Create(const nsAString& aURL, nsIPrincipal* aPrincipal, - const IPCClientInfo& aClientInfo, const bool& aDedicated, - const bool& aRequireUnreliable, + const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence<WebTransportHash>* aServerCertHashes, Endpoint<PWebTransportParent>&& aParentEndpoint, std::function<void(std::tuple<const nsresult&, const uint8_t&>)>&& aResolver); IPCResult RecvClose(const uint32_t& aCode, const nsACString& aReason);
--- a/ipc/glue/BackgroundParentImpl.cpp +++ b/ipc/glue/BackgroundParentImpl.cpp @@ -485,31 +485,29 @@ mozilla::ipc::IPCResult BackgroundParent AssertIsInMainProcess(); AssertIsOnBackgroundThread(); return mozilla::dom::CreateFileSystemManagerParent( aPrincipalInfo, std::move(aParentEndpoint), std::move(aResolver)); } mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateWebTransportParent( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const IPCClientInfo& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence<WebTransportHash>* aServerCertHashes, Endpoint<PWebTransportParent>&& aParentEndpoint, CreateWebTransportParentResolver&& aResolver) { AssertIsInMainProcess(); AssertIsOnBackgroundThread(); RefPtr<mozilla::dom::WebTransportParent> 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(); } already_AddRefed<PIdleSchedulerParent> BackgroundParentImpl::AllocPIdleSchedulerParent() { AssertIsOnBackgroundThread(); RefPtr<IdleSchedulerParent> actor = new IdleSchedulerParent(); return actor.forget();
--- a/ipc/glue/BackgroundParentImpl.h +++ b/ipc/glue/BackgroundParentImpl.h @@ -131,18 +131,17 @@ class BackgroundParentImpl : public PBac AllocPBackgroundSessionStorageServiceParent() override; mozilla::ipc::IPCResult RecvCreateFileSystemManagerParent( const PrincipalInfo& aPrincipalInfo, Endpoint<mozilla::dom::PFileSystemManagerParent>&& aParentEndpoint, CreateFileSystemManagerParentResolver&& aResolver) override; mozilla::ipc::IPCResult RecvCreateWebTransportParent( - const nsAString& aURL, nsIPrincipal* aPrincipal, - const IPCClientInfo& aClientInfo, const bool& aDedicated, + const nsAString& aURL, nsIPrincipal* aPrincipal, const bool& aDedicated, const bool& aRequireUnreliable, const uint32_t& aCongestionControl, // Sequence<WebTransportHash>* aServerCertHashes, Endpoint<PWebTransportParent>&& aParentEndpoint, CreateWebTransportParentResolver&& aResolver) override; already_AddRefed<PIdleSchedulerParent> AllocPIdleSchedulerParent() override; PTemporaryIPCBlobParent* AllocPTemporaryIPCBlobParent() override;
--- a/ipc/glue/PBackground.ipdl +++ b/ipc/glue/PBackground.ipdl @@ -50,17 +50,16 @@ include protocol PWebAuthnTransaction; include protocol PUDPSocket; include protocol PVerifySSLServerCert; include protocol PVsync; include protocol PRemoteDecoderManager; include protocol PWebSocketConnection; include protocol PWebTransport; include protocol PFetch; -include ClientIPCTypes; include DOMTypes; include IPCBlob; include IPCServiceWorkerDescriptor; include IPCServiceWorkerRegistrationDescriptor; include PBackgroundLSSharedTypes; include PBackgroundSharedTypes; include PBackgroundIDBSharedTypes; include PFileSystemParams; @@ -191,17 +190,16 @@ parent: returns(nsresult rv); /** * Finish the setup of a new PWebTransport top level protocol. */ async CreateWebTransportParent( nsString aURL, nullable nsIPrincipal aPrincipal, - IPCClientInfo aClientInfo, bool aDedicated, bool aRequireUnreliable, uint32_t aCongestionControl, /* Sequence<WebTransportHash>* aServerCertHashes, */ Endpoint<PWebTransportParent> aParentEndpoint) returns(nsresult rv, uint8_t aReliability); // Actually WebTransportReliabityMode enum async PVsync();
--- a/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp +++ b/netwerk/protocol/webtransport/WebTransportSessionProxy.cpp @@ -57,24 +57,16 @@ WebTransportSessionProxy::~WebTransportS //----------------------------------------------------------------------------- // WebTransportSessionProxy::nsIWebTransport //----------------------------------------------------------------------------- nsresult WebTransportSessionProxy::AsyncConnect( nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aSecurityFlags, WebTransportSessionEventListener* aListener) { - return AsyncConnectWithClient(aURI, aPrincipal, aSecurityFlags, aListener, - Maybe<dom::ClientInfo>()); -} - -nsresult WebTransportSessionProxy::AsyncConnectWithClient( - nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aSecurityFlags, - WebTransportSessionEventListener* aListener, - const Maybe<dom::ClientInfo>& aClientInfo) { MOZ_ASSERT(NS_IsMainThread()); LOG(("WebTransportSessionProxy::AsyncConnect")); { MutexAutoLock lock(mMutex); mListener = aListener; } auto cleanup = MakeScopeExit([self = RefPtr<WebTransportSessionProxy>(this)] { @@ -84,34 +76,22 @@ nsresult WebTransportSessionProxy::Async self->mListener = nullptr; self->ChangeState(WebTransportSessionProxyState::DONE); }); nsSecurityFlags flags = nsILoadInfo::SEC_COOKIES_OMIT | aSecurityFlags; 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<dom::ServiceWorkerDescriptor>(), - 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); // configure HTTP specific stuff nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel); if (!httpChannel) { mChannel = nullptr; return NS_ERROR_ABORT;
--- a/netwerk/protocol/webtransport/nsIWebTransport.idl +++ b/netwerk/protocol/webtransport/nsIWebTransport.idl @@ -9,49 +9,38 @@ interface WebTransportSessionEventListener; interface nsIWebTransportStreamCallback; interface nsIWebTransportBidirectionalStream; interface nsIWebTransportSendStream; interface nsIWebTransportReceiveStream; %{C++ -namespace mozilla::dom { -class ClientInfo; -} namespace mozilla::net { class Http3WebTransportSession; class Http3WebTransportStream; } %} [ptr] native Http3WebTransportSessionPtr(mozilla::net::Http3WebTransportSession); [ptr] native Http3WebTransportStreamPtr(mozilla::net::Http3WebTransportStream); native Datagram(nsTArray<uint8_t>&&); -[ref] native const_MaybeClientInfoRef(const mozilla::Maybe<mozilla::dom::ClientInfo>); [builtinclass, scriptable, uuid(c20d6e77-8cb1-4838-a88d-fff826080aa3)] interface nsIWebTransport : nsISupports { cenum WebTransportError : 16 { UNKNOWN_ERROR, INVALID_STATE_ERROR, }; // When called, perform steps in "Initialization WebTransport over HTTP". void asyncConnect(in nsIURI aURI, 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(); // Close the session. void closeSession(in uint32_t aErrorCode, in ACString aReason); // Create and open a new WebTransport stream.