-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rtcicecandidate: add relayProtocol #2763
Conversation
This is mostly a consistency issue between the candidate object and the candidate stats, see here for details. I did consider (and actually implemented) .url as well but that is already defined to be part of the icecandidate event. |
based on the hardcoded mapping of local type preference. Polyfill for w3c/webrtc-pc#2763
Editors meeting: Seems uncontroversial. |
which is already defined in webrtc-statsfippo added a commit to fippo/webrtc-stats that referenced this pull requestAug 19, 2022 fippo added a commit to fippo/webrtc-stats that referenced this pull requestAug 19, 2022
webrtc.html
Outdated
@@ -5976,6 +5976,7 @@ <h4> | |||
readonly attribute DOMString? relatedAddress; | |||
readonly attribute unsigned short? relatedPort; | |||
readonly attribute DOMString? usernameFragment; | |||
readonly attribute DOMString? relayProtocol; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a readonly attribute with predefined values it should probably be an enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you define the possible values? https://www.rfc-editor.org/rfc/rfc5928#section-3 is the closest one I could find (Table 1) but that is hardly normative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the PR defines the possible values in prose: "Valid values are "udp", "tcp", or "tls". " which seems equivalent to:
enum RTCIceTransportPolicy {
"udp",
"tcp",
"tls",
};
interface RTCIceCandidate {
...
readonly attribute RTCIceTransportPolicy? relayProtocol;
};
If those are the only valid values then we generally prefer expressing things in WebIDL when possible.
If those are not the only values then we should rephrase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If those are the only valid values then we generally prefer expressing things in WebIDL when possible.
Or at least that's been my impression. These are only ever used as output, not input so I guess it doesn't matter a whole lot (do we get any free idlharness wpt tests)? I see the stats spec is just using DOMString, and I couldn't find any design principles on this. The WebIDL spec showed no examples of a readonly attribute
using enum
... YMMV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but for the other enums we have normative references from which we can draw the values (e.g. For stats this is actually a TODO hidden here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTCIceTcpCandidateType is sort of similar here.
Having WebIDL enum is a small UA developer improvement as it can automate some binding generated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTCIceServerTransportProtocol won against RTCIceTurnRelayProtocol and variants thereof.
Reference should be to RFC 8656 Section 3.1 (which also defines DTLS transport); RFC 5766 is obsolete. |
* editorial: clarify relayProtocol stats following w3c/webrtc-pc#2763 * use RTCIceServerTransportProtocol
which is already defined in webrtc-stats
Diff