From da4c7e7ed675c3bf405668739c3012d140856109 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:42 +0200 Subject: Adding upstream version 126.0. Signed-off-by: Daniel Baumann --- dom/webtransport/api/WebTransportDatagramDuplexStream.cpp | 8 ++++---- dom/webtransport/api/WebTransportDatagramDuplexStream.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'dom/webtransport') diff --git a/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp b/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp index 30d7451414..b40991c9a1 100644 --- a/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp +++ b/dom/webtransport/api/WebTransportDatagramDuplexStream.cpp @@ -258,7 +258,7 @@ NS_IMPL_ADDREF_INHERITED(OutgoingDatagramStreamAlgorithms, NS_IMPL_RELEASE_INHERITED(OutgoingDatagramStreamAlgorithms, UnderlyingSinkAlgorithmsWrapper) -already_AddRefed OutgoingDatagramStreamAlgorithms::WriteCallback( +already_AddRefed OutgoingDatagramStreamAlgorithms::WriteCallbackImpl( JSContext* aCx, JS::Handle aChunk, WritableStreamDefaultController& aController, ErrorResult& aError) { // https://w3c.github.io/webtransport/#writedatagrams @@ -269,9 +269,9 @@ already_AddRefed OutgoingDatagramStreamAlgorithms::WriteCallback( // rejected with a TypeError. { BufferSource == ArrayBuffer/ArrayBufferView } ArrayBufferViewOrArrayBuffer arrayBuffer; if (!arrayBuffer.Init(aCx, aChunk)) { - return Promise::CreateRejectedWithTypeError( - mDatagrams->GetParentObject(), - "Wrong type for Datagram stream write"_ns, aError); + JS_ClearPendingException(aCx); + aError.ThrowTypeError("Wrong type for Datagram stream write"_ns); + return nullptr; } // Step 3: Let datagrams be transport.[[Datagrams]]. diff --git a/dom/webtransport/api/WebTransportDatagramDuplexStream.h b/dom/webtransport/api/WebTransportDatagramDuplexStream.h index 510cbcac71..a9f8ce7b56 100644 --- a/dom/webtransport/api/WebTransportDatagramDuplexStream.h +++ b/dom/webtransport/api/WebTransportDatagramDuplexStream.h @@ -71,7 +71,7 @@ class OutgoingDatagramStreamAlgorithms final // Streams algorithms - already_AddRefed WriteCallback( + already_AddRefed WriteCallbackImpl( JSContext* aCx, JS::Handle aChunk, WritableStreamDefaultController& aController, ErrorResult& aError) override; -- cgit v1.2.3