From f1c0561d03aad49c396d3b348eccee0a9150639d Mon Sep 17 00:00:00 2001 From: Sameer Vijaykar <194338+sam-vi@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:14:53 +0200 Subject: [PATCH 1/3] Convert RTCIceCandidatePair dictionary to an interface. Addresses: #2930. This commit changes the dictionary to an interface and required dictionary members to readonly attributes backed by internal slots. No constructor is described in the IDL, since RTCIceCandidatePair is only created by the user agent as a result of the ICE agent forming an ICE candidate pair. The application cannot construct arbitrary candidate pairs. --- webrtc.html | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/webrtc.html b/webrtc.html index 670c9c665..a936831f6 100644 --- a/webrtc.html +++ b/webrtc.html @@ -12670,35 +12670,56 @@

- RTCIceCandidatePair Dictionary + RTCIceCandidatePair Interface

+

+ This interface represents an ICE candidate pair, described in Section 4 in [[RFC8445]]. An {{RTCIceCandidatePair}} is a pairing of a local and a remote {{RTCIceCandidate}}. +

+

+ To create an RTCIceCandidatePair with {{RTCIceCandidate}} objects, |local:RTCIceCandidate| and |remote:RTCIceCandidate|, run the following steps: +

+
    +
  1. + Let |candidatePair:RTCIceCandidatePair| be a newly created {{RTCIceCandidatePair}} object. +
  2. +
  3. + Let |candidatePair| have a [[\Local]] internal slot, initialized to |local|. +
  4. +
  5. + Let |candidatePair| have a [[\Remote]] internal slot, initialized to |remote|. +
  6. +
  7. + Return |candidatePair|. +
  8. +
-
dictionary RTCIceCandidatePair {
-  required RTCIceCandidate local;
-  required RTCIceCandidate remote;
+            
[Exposed=Window]
+interface RTCIceCandidatePair {
+  [SameObject] readonly attribute RTCIceCandidate local;
+  [SameObject] readonly attribute RTCIceCandidate remote;
 };

- Dictionary {{RTCIceCandidatePair}} Members + Attributes

+ "RTCIceCandidatePair" class="attributes">
local of type {{RTCIceCandidate}} + "idlAttrType">{{RTCIceCandidate}}, readonly

- The local ICE candidate. + The {{local}} attribute MUST, on getting, return the value of the {{RTCIceCandidatePair/[[Local]]}} internal slot.

remote of type {{RTCIceCandidate}} + "idlAttrType">{{RTCIceCandidate}}, readonly

- The remote ICE candidate. + The {{remote}} attribute MUST, on getting, return the value of the {{RTCIceCandidatePair/[[Remote]]}} internal slot.

From 40de7d591c6be6edbcc9f06ccba623d7c333dbd4 Mon Sep 17 00:00:00 2001 From: Sameer Vijaykar <194338+sam-vi@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:05:16 +0200 Subject: [PATCH 2/3] Use the create an RTCIceCandidatePair algorithm in RTCIceTransport. --- webrtc.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/webrtc.html b/webrtc.html index a936831f6..9a5b7778a 100644 --- a/webrtc.html +++ b/webrtc.html @@ -12344,9 +12344,7 @@

  1. - Let newCandidatePair be a newly created - {{RTCIceCandidatePair}} representing the indicated pair if - one is selected, and null otherwise. + Let newCandidatePair be the result of [= creating an RTCIceCandidatePair =] with |local:RTCIceCandidate| and |remote:RTCIceCandidate|, representing the local and remote candidates of the indicated pair if one is selected, and null otherwise.

  2. @@ -12676,7 +12674,7 @@

    This interface represents an ICE candidate pair, described in Section 4 in [[RFC8445]]. An {{RTCIceCandidatePair}} is a pairing of a local and a remote {{RTCIceCandidate}}.

    - To create an RTCIceCandidatePair with {{RTCIceCandidate}} objects, |local:RTCIceCandidate| and |remote:RTCIceCandidate|, run the following steps: + To create an RTCIceCandidatePair with {{RTCIceCandidate}} objects, |local:RTCIceCandidate| and |remote:RTCIceCandidate|, run the following steps:

    1. From e6438cfa466aa8568006af5f7802b526255ad33d Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Fri, 19 Apr 2024 08:33:19 +0200 Subject: [PATCH 3/3] Document change as candidate addition --- amendments.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/amendments.json b/amendments.json index 9d946b728..101db18b9 100644 --- a/amendments.json +++ b/amendments.json @@ -895,5 +895,14 @@ "web-platform-tests/wpt#45427" ] } + ], + "rtcicecandidatepair": [ + { + "description": "Convert RTCIceCandidatePair dictionary to an interface", + "pr": 2961, + "type": "addition", + "status": "candidate", + "id": 45 + } ] }