W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2012

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

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Tue, 19 Jun 2012 13:29:29 +0200
Message-ID: <4FE06299.9040507@ericsson.com>
To: Anant Narayanan <anant@mozilla.com>
CC: Harald Alvestrand <harald@alvestrand.no>, Dominique Hazael-Massieux <dom@w3.org>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On 2012-06-18 22:06, Anant Narayanan wrote:
> 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 (...)]

The above is not allowed, but the spec says that a [NamedConstructor] 
extended attribute is OK together with [NoInterfaceObject].

I guess the tricky thing is to only expose the constructor under the 
PeerConnection namespace (and not in the global namespace, which I think 
would happen with [NamedConstructor=Foo] above). Any ideas on how to get 
around that Anant?

/Adam

> 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 Tuesday, 19 June 2012 11:29:54 UTC

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