Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / webidl / WebTransport.webidl
blob338249b817c70dda2e38541e534695ee1ca2694e
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* https://w3c.github.io/webtransport */
8 /* https://w3c.github.io/webtransport/#web-transport-configuration */
10 dictionary WebTransportHash {
11   DOMString algorithm;
12   BufferSource value;
15 dictionary WebTransportOptions {
16   boolean allowPooling = false;
17   boolean requireUnreliable = false;
18   sequence<WebTransportHash> serverCertificateHashes;
19   WebTransportCongestionControl congestionControl = "default";
22 enum WebTransportCongestionControl {
23   "default",
24   "throughput",
25   "low-latency",
28 /* https://w3c.github.io/webtransport/#web-transport-close-info */
30 dictionary WebTransportCloseInfo {
31   unsigned long closeCode = 0;
32   UTF8String reason = "";
35 /* https://w3c.github.io/webtransport/#uni-stream-options */
36 dictionary WebTransportSendStreamOptions {
37   long long? sendOrder = null;
40 /* https://w3c.github.io/webtransport/#web-transport-stats */
42 dictionary WebTransportStats {
43   DOMHighResTimeStamp timestamp;
44   unsigned long long bytesSent;
45   unsigned long long packetsSent;
46   unsigned long long packetsLost;
47   unsigned long numOutgoingStreamsCreated;
48   unsigned long numIncomingStreamsCreated;
49   unsigned long long bytesReceived;
50   unsigned long long packetsReceived;
51   DOMHighResTimeStamp smoothedRtt;
52   DOMHighResTimeStamp rttVariation;
53   DOMHighResTimeStamp minRtt;
54   WebTransportDatagramStats datagrams;
57 /* https://w3c.github.io/webtransport/#web-transport-stats%E2%91%A0 */
59 dictionary WebTransportDatagramStats {
60   DOMHighResTimeStamp timestamp;
61   unsigned long long expiredOutgoing;
62   unsigned long long droppedIncoming;
63   unsigned long long lostOutgoing;
66 /* https://w3c.github.io/webtransport/#web-transport */
68 [Exposed=(Window,Worker), SecureContext, Pref="network.webtransport.enabled"]
69 interface WebTransport {
70   [Throws]
71   constructor(USVString url, optional WebTransportOptions options = {});
73   [NewObject]
74   Promise<WebTransportStats> getStats();
75   readonly attribute Promise<undefined> ready;
76   readonly attribute WebTransportReliabilityMode reliability;
77   readonly attribute WebTransportCongestionControl congestionControl;
78   readonly attribute Promise<WebTransportCloseInfo> closed;
79   [Throws] undefined close(optional WebTransportCloseInfo closeInfo = {});
81   [Throws] readonly attribute WebTransportDatagramDuplexStream datagrams;
83   [NewObject]
84   Promise<WebTransportBidirectionalStream> createBidirectionalStream(
85      optional WebTransportSendStreamOptions options = {});
86   /* a ReadableStream of WebTransportBidirectionalStream objects */
87   readonly attribute ReadableStream incomingBidirectionalStreams;
90   /* XXX spec says this should be WebTransportSendStream */
91   [NewObject]
92   Promise<WritableStream> createUnidirectionalStream(
93     optional WebTransportSendStreamOptions options = {});
94   /* a ReadableStream of WebTransportReceiveStream objects */
95   readonly attribute ReadableStream incomingUnidirectionalStreams;
98 enum WebTransportReliabilityMode {
99   "pending",
100   "reliable-only",
101   "supports-unreliable",