W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: [File API] events vs callbacks

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 11 Aug 2009 18:23:32 -0700
Message-ID: <63df84f0908111823q1606ef46wed5266b05f45ba35@mail.gmail.com>
To: Olli Pettay <Olli.Pettay@helsinki.fi>
Cc: Anne van Kesteren <annevk@opera.com>, arun@mozilla.com, Web Applications Working Group WG <public-webapps@w3.org>
On Tue, Aug 11, 2009 at 6:11 PM, Jonas Sicking<jonas@sicking.cc> wrote:
> On Tue, Aug 11, 2009 at 2:25 PM, Olli Pettay<Olli.Pettay@helsinki.fi> wrote:
>> On 8/11/09 11:57 PM, Jonas Sicking wrote:
>>> My concern isn't that there are ways of using it correctly, my concern
>>> is that it's very easy to use incorrectly with bugs as a result.
>> How? Especially if we prevent more than one read at time. How is the
>> situation any worse than with XHR?
> That just changes things so that instead of getting unexpected events,
> you'll get an unexpected exception when calling .readX. That doesn't
> seem to improve things.

Sorry, didn't respond to the XHR part.

XHR is a different type of object than File. XHR represents a request
for a resource, so there is no reason to pass that around to anyone.
If others want to read from that resource you can just pass them the

The File object represents the actual resource. If others want to read
from it I think we can expect people to pass a reference to the same
File object around.

Again, I do realize that we can just ask people to splice and pass
around the splice, or pass around the actual File, but ask them to
call splice before they read. But I think it's very likely that people
will forget to do that. I think it's poor interface design to make the
easy thing to do unsafe.

/ Jonas
Received on Wednesday, 12 August 2009 01:24:31 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 13:55:28 UTC