RE: A small proposal to cleanup DataChannel construction.

Within the current proposal, the RTCDataChannelParameters dictionary would look like this:


dictionary RTCDataChannelParameters {

    DOMString      id<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-id> = "";

    DOMString      type<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-type> = "";  // Do we still need this?

    boolean        outOfOrderAllowed<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-outOfOrderAllowed> = false;

    unsigned short maxRetransmitTime<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-maxRetransmitTime> = null;

    unsigned short maxRetransmitNum<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-maxRetransmitNum> = null;

    DOMString      protocol<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-protocol> = "";

    boolean        preset<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-preset> = false;

    unsigned short stream<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannelParameters-stream> = null;

};

With dictionary inheritance, it might look like this:


dictionary RTCDataChannelParameters {

    DOMString id<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCDataChannelParameters-id> = "";

    DOMString type<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCDataChannelParameters-type> = ""; // Do we still need this?

};



dictionary RTCSctpDataChannelParameters : RTCDataChannelParameters<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#idl-def-RTCDataChannelParameters> {

    boolean        outOfOrderAllowed<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-outOfOrderAllowed> = false;

    unsigned short maxRetransmitTime<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-maxRetransmitTime> = null;

    unsigned short maxRetransmitNum<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-maxRetransmitNum> = null;

    DOMString      protocol<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-protocol> = "";

    boolean        preset<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-preset> = false;

    unsigned short stream<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpDataChannelParameters-stream> = null;

};

The rest of it looks like this:

[Constructor(RTCDataTransport transport, RTCDataChannelParameters parameters)]
interface RTCDataChannel : EventTarget {
    readonly    attribute RTCDataTransport<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCDataTransport>         transport<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannel-transport>;
    readonly    attribute RTCDataChannelParameters<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCDataChannelParameters> parameters<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannel-parameters>;
    void send<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannel-send-void-Object-data> (Object data);
                attribute EventHandler             ondata<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCDataChannel-ondata>;
};




[Constructor(RTCDtlsTransport)]

interface RTCSctpTransport : RTCDataTransport<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCDataTransport> {

                attribute RTCDtlsTransport<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCDtlsTransport> transport<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCSctpTransport-transport>;

    static RTCSctpCapabilities<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCSctpCapabilities> getCapabilities<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCSctpTransport-getCapabilities-RTCSctpCapabilities> ();

    void                       start<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCSctpTransport-start-void-RTCSctpCapabilities-remoteCaps> (RTCSctpCapabilities<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#idl-def-RTCSctpCapabilities> remoteCaps);

    void                       stop<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCSctpTransport-stop-void> ();

                attribute EventHandler     ondatachannel<http://internaut.com:8080/~baboba/orca/ortc-4-22-2014-revised.html#widl-RTCSctpTransport-ondatachannel>;

};


dictionary RTCSctpCapabilities {

    unsigned int maxMessageSize<http://internaut.com:8080/~baboba/orca/ortc-4-23-2014-revised.html#widl-RTCSctpCapabilities-maxMessageSize> = null;

};



From: Justin Uberti [mailto:juberti@google.com]
Sent: Tuesday, April 22, 2014 1:51 PM
To: Robin Raymond
Cc: Peter Thatcher; public-ortc@w3.org
Subject: Re: A small proposal to cleanup DataChannel construction.

Anything specific in mind? If we feel the parameters are too closely coupled to SCTP, I would prefer to try to abstract them so that app developers can be agnostic to the underlying transport.

On Tue, Apr 22, 2014 at 10:50 AM, Robin Raymond <robin@hookflash.com<mailto:robin@hookflash.com>> wrote:

I like but the only issue I have is that RTCDataChannelParameters needs to be abstracted and there needs to be RTCSctpDataChannelParameters derived from RTCDataChannelParameters . Many of the options within "RTCSctpDataChannelParameters" will not necessarily make sense for alternative transport types with alternative optional "RTCDataChannelParameters " values for that transport type. We can put common things like "ID" in a base RTCDataChannelParameters .

Does WebIDL allow downcasting of dictionaries or does RTCDataChannelParameters need to be an interface to support downcasting? I know WebIDL allows dictionary inheritance and upcasting is clear because of the example for WebIDL dictionaries, but downcasting is not clearly defined.

-Robin



[cid:image001.jpg@01CF5E34.E539BB30]
Peter Thatcher<mailto:pthatcher@google.com>
April 15, 2014 at 1:04 PM
I've noticed that createDataChannel and the RTCDataChannel contructor overlap in functionality.  And since almost all of the current API is based around using constructors instead of factory methods, I think we can cleanup the overlap and make it consistent with the rest of the API by doing the following:

[Constructor(RTCDataTransport transport,

RTCDataChannelParameters parameters)]

interface RTCDataChannel : EventTarget {

   readonly attribute RTCDataTransport transport;

   readonly attribute RTCDataChannelParameters parameters;

   void send (Object data);

   attribute EventHandler ondata;

};


interface RTCDataTransport {

}


interface RTCSctpTransport : RTCDataTransport {

 // ...
}

Received on Tuesday, 22 April 2014 21:31:41 UTC