summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/webtransport/web_transport.idl
blob: 2ee5578a1ab45fdf49de197aad75e89c60b8778a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://w3c.github.io/webtransport/#web-transport
[
    ActiveScriptWrappable,
    Exposed=(Window,Worker),
    RuntimeEnabled=WebTransport
] interface WebTransport {
  [CallWith=ScriptState, RaisesException, MeasureAs=WebTransport] constructor(USVString url, optional WebTransportOptions options = {});
  [CallWith=ScriptState, RaisesException] Promise<SendStream>
      createUnidirectionalStream();
  readonly attribute ReadableStream incomingUnidirectionalStreams;

  [CallWith=ScriptState, RaisesException] Promise<BidirectionalStream>
      createBidirectionalStream();
  readonly attribute ReadableStream incomingBidirectionalStreams;

  readonly attribute DatagramDuplexStream datagrams;

  // datagramWritable and datagramReadable are retained for backwards
  // compatibility.
  // TODO(ricea): Remove these before shipping.
  readonly attribute WritableStream datagramWritable;
  readonly attribute ReadableStream datagramReadable;

  void close(optional WebTransportCloseInfo closeInfo = {});
  readonly attribute Promise<void> ready;
  readonly attribute Promise<WebTransportCloseInfo> closed;

  // This is an experimental and non-standard function. Sets the duration
  // which determines whether an outgoing datagram should be discarded due to
  // being in the queue for too long, in milliseconds.
  void setDatagramWritableQueueExpirationDuration(double ms);
};