summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/peerconnection/rtc_ice_transport.idl
blob: a2aca1fe626a75bc6ecdb7efcffdab3e4f139b18 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2018 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/webrtc-pc/#dom-rtcicerole
enum RTCIceRole {
    "controlling",
    "controlled",
};

// https://w3c.github.io/webrtc-pc/#dom-rtcicetransportstate
enum RTCIceTransportState {
    "new",
    "checking",
    "connected",
    "completed",
    "disconnected",
    "failed",
    "closed",
};

// https://w3c.github.io/webrtc-pc/#dom-rtcicegatheringstate
enum RTCIceGatheringState {
    "new",
    "gathering",
    "complete"
};

// https://w3c.github.io/webrtc-pc/#rtcicetransport
[
   ActiveScriptWrappable,
   // Constructor from https://w3c.github.io/webrtc-ice/#rtcicetransport*
   Constructor(),
   ConstructorCallWith=ExecutionContext,
   Exposed=Window,
   RuntimeEnabled=RTCIceTransportExtension
] interface RTCIceTransport : EventTarget {
    // TODO(github.com/w3c/webrtc-ice/issues/4): role is non-null in the
    // WebRTC-PC specification.
    readonly attribute RTCIceRole? role;
    readonly attribute RTCIceTransportState state;
    readonly attribute RTCIceGatheringState gatheringState;
    sequence<RTCIceCandidate> getLocalCandidates();
    sequence<RTCIceCandidate> getRemoteCandidates();
    RTCIceCandidatePair? getSelectedCandidatePair();
    RTCIceParameters? getLocalParameters();
    RTCIceParameters? getRemoteParameters();
    attribute EventHandler onstatechange;
    attribute EventHandler ongatheringstatechange;
    // TODO(crbug.com/864871): Implement onselectedcandidatepairchange.

    // The following is defined in the WebRTC-ICE extension specification.
    // https://w3c.github.io/webrtc-ice/#rtcicetransport*
    [RaisesException] void gather(RTCIceGatherOptions options);
    [RaisesException] void start(RTCIceParameters remoteParameters, optional RTCIceRole role = "controlled");
    void stop();
    [RaisesException] void addRemoteCandidate(RTCIceCandidate remoteCandidate);
    // TODO(crbug.com/864871): Implement onerror.
    attribute EventHandler onicecandidate;
};