W3C home > Mailing lists > Public > public-webrtc@w3.org > November 2014

Why is RTCIceCandidate mutable

From: Martin Thomson <martin.thomson@gmail.com>
Date: Tue, 4 Nov 2014 14:59:02 -0800
Message-ID: <CABkgnnWpHAs54koz7sONt-+jMfM1OXqrE0Osgk7AjJotpaFRfA@mail.gmail.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26644

It's strange to me that we should permit RTCIceCandidate being
mutable.  Can anyone explain why this is so?

Having it mutable opens all sorts of strange error cases: particularly
those where candidates are passed to RTCPeerConnection and then
mutated by script after basic sanity checks have been passed.

Here's what I think the definition should look like:

[Constructor(RTCIceCandidateInit init)]
interface RTCIceCandidate {
  readonly attribute DOMString candidate;
  readonly attribute DOMString? sdpMid;
  readonly attribute unsigned short? sdpMLineIndex;

Note that the current definition also allows for the init dictionary
to be omitted or empty.  I would prefer that script only be allowed to
create candidates that are basically valid.  Syntax checking might be
deferred, but I see no reason to permit a missing or null candidate

I originally thought that this might be to support the terminal (or
null) candidate on the icecandidate event.  But that relies on the
candidate value in RTCIceCandidateEvent being null.

I plan to include these changes in my pull request for 26644.
Received on Tuesday, 4 November 2014 22:59:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:42 UTC