From d8352e720c98edd7637e488d6bb9c10021f0ba32 Mon Sep 17 00:00:00 2001 From: Byron Campen Date: Wed, 21 Feb 2024 17:21:17 +0000 Subject: [PATCH] Bug 1811912: webidl for RTCIceTransport r=jib,webidl,saschanaz Differential Revision: https://phabricator.services.mozilla.com/D193125 --- .../mochitest/general/test_interfaces.js | 2 + dom/webidl/RTCDtlsTransport.webidl | 1 + dom/webidl/RTCIceTransport.webidl | 43 +++++++++++++++++++ dom/webidl/RTCPeerConnection.webidl | 14 +++--- dom/webidl/moz.build | 1 + xpcom/ds/StaticAtoms.py | 1 + 6 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 dom/webidl/RTCIceTransport.webidl diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index ea49531ff6cc..d002a4f30de9 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -1068,6 +1068,8 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCIceCandidate", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "RTCIceTransport", insecureContext: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCPeerConnection", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "RTCPeerConnectionIceEvent", insecureContext: true }, diff --git a/dom/webidl/RTCDtlsTransport.webidl b/dom/webidl/RTCDtlsTransport.webidl index 0b2f095ab6f7..99b70af47060 100644 --- a/dom/webidl/RTCDtlsTransport.webidl +++ b/dom/webidl/RTCDtlsTransport.webidl @@ -18,6 +18,7 @@ enum RTCDtlsTransportState { [Pref="media.peerconnection.enabled", Exposed=Window] interface RTCDtlsTransport : EventTarget { + [SameObject] readonly attribute RTCIceTransport iceTransport; readonly attribute RTCDtlsTransportState state; attribute EventHandler onstatechange; }; diff --git a/dom/webidl/RTCIceTransport.webidl b/dom/webidl/RTCIceTransport.webidl new file mode 100644 index 000000000000..35a1c7401805 --- /dev/null +++ b/dom/webidl/RTCIceTransport.webidl @@ -0,0 +1,43 @@ +/* -*- 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/webrtc-pc/#dom-rtcicetransport + */ + +enum RTCIceTransportState { + "closed", + "failed", + "disconnected", + "new", + "checking", + "completed", + "connected" +}; + +enum RTCIceGathererState { + "new", + "gathering", + "complete" +}; + +[Exposed=Window] +interface RTCIceTransport : EventTarget { + // TODO(bug 1307994) + // readonly attribute RTCIceRole role; + // readonly attribute RTCIceComponent component; + readonly attribute RTCIceTransportState state; + readonly attribute RTCIceGathererState gatheringState; + // TODO(bug 1307994) + // sequence getLocalCandidates(); + // sequence getRemoteCandidates(); + // RTCIceCandidatePair? getSelectedCandidatePair(); + // RTCIceParameters? getLocalParameters(); + // RTCIceParameters? getRemoteParameters(); + attribute EventHandler onstatechange; + attribute EventHandler ongatheringstatechange; + // TODO(bug 1307994) + // attribute EventHandler onselectedcandidatepairchange; +}; diff --git a/dom/webidl/RTCPeerConnection.webidl b/dom/webidl/RTCPeerConnection.webidl index 8fb908788e67..dee367c11383 100644 --- a/dom/webidl/RTCPeerConnection.webidl +++ b/dom/webidl/RTCPeerConnection.webidl @@ -27,13 +27,13 @@ enum RTCIceGatheringState { }; enum RTCIceConnectionState { - "new", - "checking", - "connected", - "completed", - "failed", - "disconnected", - "closed" + "closed", + "failed", + "disconnected", + "new", + "checking", + "completed", + "connected" }; enum RTCPeerConnectionState { diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index aa20319830c8..c47db0422b4f 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -1047,6 +1047,7 @@ if CONFIG["MOZ_WEBRTC"]: "RTCEncodedAudioFrame.webidl", "RTCEncodedVideoFrame.webidl", "RTCIceCandidate.webidl", + "RTCIceTransport.webidl", "RTCIdentityAssertion.webidl", "RTCIdentityProvider.webidl", "RTCPeerConnection.webidl", diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py index f6ca3cd7cb08..bf356fc9c709 100644 --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py @@ -833,6 +833,7 @@ STATIC_ATOMS = [ Atom("onfocusout", "onfocusout"), Atom("onfullscreenchange", "onfullscreenchange"), Atom("onfullscreenerror", "onfullscreenerror"), + Atom("ongatheringstatechange", "ongatheringstatechange"), Atom("onget", "onget"), Atom("onhashchange", "onhashchange"), Atom("oninput", "oninput"),