Re: Transferable Objects, was: Re: Web Messaging Intents, was: Re: [DRAFT] Web Intents Task Force Charter

Paul Kinlan wrote:
> On Tue, Nov 22, 2011 at 3:32 PM, Rich Tibbett<richt@opera.com>  wrote:
>> Paul Kinlan wrote:
>>>
>>> Someone mentioned earlier get-temperature as an example:
>>> var channel = new MessageChannel()
>>> var i = new Intent('get-temperature',
>>> "application/octet-stream+myprotocol", channel.port2)
>>> navigator.startActivity(i);
>>>
>> I'm missing how channel.port2 gets propagated to the selected Intent Handler
>> if it is not designated as a Transferable parameter. If the _exact_ port2
>> object is not transferred, then there is no messaging channel to use in the
>> first place...
...
>>
>> I may be missing a trick here.
>
...
> startActivity uses
> the structured clone algorithm, that support Transferable objects.

Of course! Until recently MessagePort wasn't compatible with the 
structured clone algorithm but since it has recently come to implement 
Transferable it has become compatible with that algorithm, making your 
example work and negating the need for a fourth parameter specifically 
for Transferable objects.

Thanks for the explanation. This is helpful. I hope we can document this 
level of detail in a specification soon.

- Rich

Received on Tuesday, 22 November 2011 16:11:30 UTC