W3C home > Mailing lists > Public > public-webrtc@w3.org > August 2013

Re: Stats variables - some more input

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 07 Aug 2013 21:24:06 -0400
Message-ID: <5202F336.7050506@mozilla.com>
To: Harald Alvestrand <harald@alvestrand.no>
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>
On 8/6/13 11:57 AM, Jan-Ivar Bruaroey wrote:
> typedef (RTCStats or
>            RTCRTPStreamStats or
>            RTCInboundRTPStreamStats or
>            RTCOutboundRTPStreamStats or
>            RTCMediaStreamTrackStats or
>            MediaStream or
>            RTCTransport or
>            RTCIceComponentStats or
>            RTCIceCandidatePairStats or
>            RTCIceCandidate or
>            RTCCodec) AnyRTCStats;
>
> and have the API return AnyRTCStats.

Sorry I spoke too soon. Turns out multiple dictionaries in a union 
aren't distinguishable from each other as types in general (a problem 
mostly with input-args, a shame as we'd use them solely as return types 
in our case). Our webidl compiler says:

WebIDL.WebIDLError: error: Flat member types of a union should be 
distinguishable, RTCInboundRTPStreamStats (Wrapper) is not 
distinguishable from RTCOutboundRTPStreamStats (Wrapper), 
RTCStatsReport.webidl line 95:8

So the API may have to return an object of type object to be 
functionally sound webidl in practice, with a comment about it returning 
RTCStats-derived dictionaries. I.e. change what I proposed to:

   [MapClass(DOMString, object)]
   interface RTCStatsReport {};

.: Jan-Ivar :.
Received on Thursday, 8 August 2013 01:24:34 UTC

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