Re: [ACTION-43] (sdp related objects and global namespace) - way forward

On 6/18/12 4:51 AM, Harald Alvestrand wrote:
> On 06/16/2012 06:57 AM, Anant Narayanan wrote:
>>
>> const SD = PeerConnection.SessionDescription;
>> const IC = PeerConnection.ICECandidate;
>> ...
>> var foo = new SD();
>> var bar = new IC();

> 2 questions:
>
> 1) Anant, can you write out how this should be specified in WebIDL? It's
> not obvious to me that it's even possible to write an interface inside
> another interface.

I think the following is valid:

[NoInterfaceObject]
[Constructor (...)]
interface SessionDescription {
   ...
}

interface PeerConnection {
   attribute Function SessionDescription;
}

Navigator implements PeerConnection;

Speaking from an implementation point of view, PeerConnection.<object> 
is certainly possible. However, Justin and Adam are correct in that 
there aren't a lot of WebAPIs that do this sort of thing. It still is my 
preferred syntax though :)

-Anant

Received on Monday, 18 June 2012 20:07:27 UTC