| // 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, |
| Measure, |
| SecureContext |
| ] interface RTCIceTransport : EventTarget { |
| // TODO(github.com/w3c/webrtc-ice/issues/4): role is non-null in the |
| // WebRTC-PC specification. |
| [Measure] readonly attribute RTCIceRole? role; |
| [Measure] readonly attribute RTCIceTransportState state; |
| [Measure] readonly attribute RTCIceGatheringState gatheringState; |
| [Measure] sequence<RTCIceCandidate> getLocalCandidates(); |
| [Measure] sequence<RTCIceCandidate> getRemoteCandidates(); |
| [Measure] RTCIceCandidatePair? getSelectedCandidatePair(); |
| [Measure] RTCIceParameters? getLocalParameters(); |
| [Measure] RTCIceParameters? getRemoteParameters(); |
| attribute EventHandler onstatechange; |
| attribute EventHandler ongatheringstatechange; |
| attribute EventHandler onselectedcandidatepairchange; |
| |
| // The following is defined in the WebRTC-ICE extension specification. |
| // https://w3c.github.io/webrtc-ice/#rtcicetransport* |
| [RuntimeEnabled=RTCIceTransportExtension, RaisesException] void gather(RTCIceGatherOptions options); |
| [RuntimeEnabled=RTCIceTransportExtension, RaisesException] void start(RTCIceParameters remoteParameters, optional RTCIceRole role = "controlled"); |
| [RuntimeEnabled=RTCIceTransportExtension] void stop(); |
| [RuntimeEnabled=RTCIceTransportExtension, RaisesException] void addRemoteCandidate(RTCIceCandidate remoteCandidate); |
| // TODO(crbug.com/864871): Implement onerror. |
| [RuntimeEnabled=RTCIceTransportExtension] attribute EventHandler onicecandidate; |
| }; |