From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/webidl/WebTransport.webidl | 102 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 dom/webidl/WebTransport.webidl (limited to 'dom/webidl/WebTransport.webidl') diff --git a/dom/webidl/WebTransport.webidl b/dom/webidl/WebTransport.webidl new file mode 100644 index 0000000000..338249b817 --- /dev/null +++ b/dom/webidl/WebTransport.webidl @@ -0,0 +1,102 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +/* https://w3c.github.io/webtransport */ + +/* https://w3c.github.io/webtransport/#web-transport-configuration */ + +dictionary WebTransportHash { + DOMString algorithm; + BufferSource value; +}; + +dictionary WebTransportOptions { + boolean allowPooling = false; + boolean requireUnreliable = false; + sequence serverCertificateHashes; + WebTransportCongestionControl congestionControl = "default"; +}; + +enum WebTransportCongestionControl { + "default", + "throughput", + "low-latency", +}; + +/* https://w3c.github.io/webtransport/#web-transport-close-info */ + +dictionary WebTransportCloseInfo { + unsigned long closeCode = 0; + UTF8String reason = ""; +}; + +/* https://w3c.github.io/webtransport/#uni-stream-options */ +dictionary WebTransportSendStreamOptions { + long long? sendOrder = null; +}; + +/* https://w3c.github.io/webtransport/#web-transport-stats */ + +dictionary WebTransportStats { + DOMHighResTimeStamp timestamp; + unsigned long long bytesSent; + unsigned long long packetsSent; + unsigned long long packetsLost; + unsigned long numOutgoingStreamsCreated; + unsigned long numIncomingStreamsCreated; + unsigned long long bytesReceived; + unsigned long long packetsReceived; + DOMHighResTimeStamp smoothedRtt; + DOMHighResTimeStamp rttVariation; + DOMHighResTimeStamp minRtt; + WebTransportDatagramStats datagrams; +}; + +/* https://w3c.github.io/webtransport/#web-transport-stats%E2%91%A0 */ + +dictionary WebTransportDatagramStats { + DOMHighResTimeStamp timestamp; + unsigned long long expiredOutgoing; + unsigned long long droppedIncoming; + unsigned long long lostOutgoing; +}; + +/* https://w3c.github.io/webtransport/#web-transport */ + +[Exposed=(Window,Worker), SecureContext, Pref="network.webtransport.enabled"] +interface WebTransport { + [Throws] + constructor(USVString url, optional WebTransportOptions options = {}); + + [NewObject] + Promise getStats(); + readonly attribute Promise ready; + readonly attribute WebTransportReliabilityMode reliability; + readonly attribute WebTransportCongestionControl congestionControl; + readonly attribute Promise closed; + [Throws] undefined close(optional WebTransportCloseInfo closeInfo = {}); + + [Throws] readonly attribute WebTransportDatagramDuplexStream datagrams; + + [NewObject] + Promise createBidirectionalStream( + optional WebTransportSendStreamOptions options = {}); + /* a ReadableStream of WebTransportBidirectionalStream objects */ + readonly attribute ReadableStream incomingBidirectionalStreams; + + + /* XXX spec says this should be WebTransportSendStream */ + [NewObject] + Promise createUnidirectionalStream( + optional WebTransportSendStreamOptions options = {}); + /* a ReadableStream of WebTransportReceiveStream objects */ + readonly attribute ReadableStream incomingUnidirectionalStreams; +}; + +enum WebTransportReliabilityMode { + "pending", + "reliable-only", + "supports-unreliable", +}; -- cgit v1.2.3