Re: Supporting extra parameters on the Intent object

Because we want the data described by the "type", specifically a
mime-type, to describe the just the data being sent.  If you say it is
an image/jpeg it must be a JPEG image that is received (which does not
include the file name), not a JSON object with arbitrary values
defined.

Other areas where this can be used are intents like "share" where you
share a text/uri-list (a collection of URL's) and you want it them to
be annotated with the title of the page... this is extra meta-data
that is not core to the data being sent but adds extra value.

Some of these will be able to be defined by a richer type such as
application/x-activity-stream-article
(http://activitystrea.ms/head/activity-schema.html#article) which
might be more relevant in some cases but adds extra overhead and
reduces the number of potential services that might support the
action.

P

On Mon, Jan 30, 2012 at 1:23 PM, Mounir Lamouri <mounir@lamouri.fr> wrote:
> On 01/30/2012 03:18 AM, James Hawkins wrote:
>> [Constructor(in string action, in string type, in any data)]
>> interface Intent {
>>     readonly attribute DOMString action;
>>     readonly attribute DOMString type;
>>     readonly attribute any data;
>>     readonly attribute Dictionary extras;  <--- Added
>>     void postResult (any data, optional Dictionary extras);      <---
>> |extras| added
>>     void postFailure (any data);
>> };
>
> Given that |data| is already of type |any| why can't it just be of
> specific type |Dictionary| when needed?
>
> --
> Mounir
>



-- 
Paul Kinlan
Developer Advocate @ Google for Chrome and HTML5
G+: http://plus.ly/paul.kinlan
t: +447730517944
tw: @Paul_Kinlan
LinkedIn: http://uk.linkedin.com/in/paulkinlan
Blog: http://paul.kinlan.me
Skype: paul.kinlan

Received on Monday, 30 January 2012 13:31:12 UTC