Re: Adding fields for transfer map to Intent constructor

On 3/12/2012 12:52 PM, Greg Billock wrote:
> new Intent(action, type, data, transferables_array)
>
> and in delivery, the Intent object would have a 'ports' field where
> passed ports would be recovered.
>
> For passing transferables in the reverse direction, we'd have
>
> postResult(data, transferables_array)
>
> and in the client, this would translate to
>
> onSuccess(data, ports)
>
> This has the disadvantages and advantages of parallelism with the
> existing transferables uses.
>
> Any opinions or alternatives to consider? I haven't made the 'extras'
> change to the spec yet because this change would be competing for that
> same spot. If there's no objection to adding this transferables array
> argument, I'll add them both at the same time.

Here are my attempts at WebIDL from the specs and recent web messaging 
drafts:
http://dev.w3.org/html5/postmsg/
optional Dictionary extras
optional sequence<Transferable> transfer

Changes to the Constructor and Intent interface:
[Constructor
(DOMString action, DOMString type, any data, optional 
sequence<Transferable> transfer),
Constructor
(DOMString action, DOMString type, any data, optional Dictionary extras)]
interface Intent {}

partial interface Intent {
     ...
     readonly attribute Dictionary? extras;
     readonly attribute MessagePort[]? ports;
     void postResult (any data, optional sequence<Transferable> transfer);
}

Received on Monday, 12 March 2012 20:18:50 UTC