Re: Stats variables - some more input

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