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

Re: Lifetime of Blob URL

From: Darin Fisher <darin@chromium.org>
Date: Tue, 31 Aug 2010 08:46:04 -0700
Message-ID: <AANLkTi=fvVjfbBGaYzq8Kxz-uvhN2XDew0OXTYkP8Xtr@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: Jonas Sicking <jonas@sicking.cc>, arun@mozilla.com, Jian Li <jianli@chromium.org>, Eric Uhrhane <ericu@google.com>, Dmitry Titov <dimich@chromium.org>, Michael Nordman <michaeln@google.com>, David Levin <levin@google.com>, Adrian Bateman <adrianba@microsoft.com>, Web Applications Working Group WG <public-webapps@w3.org>
On Mon, Aug 30, 2010 at 10:52 PM, Anne van Kesteren <annevk@opera.com>wrote:

> On Tue, 31 Aug 2010 01:22:45 +0200, Darin Fisher <darin@chromium.org>
> wrote:
>
>> Another idea (possibly a crazy one) would be to eliminate Blob, and just
>> use File for everything.  We could rename BlobBuilder to FileBuilder and
>> have it return a File instead of a Blob.  Same goes for Blob.slice().  Of
>> course,
>> the File would not necessarily correspond to a real physical file on disk
>> for performance reasons.
>>
>
> Not having Blob at all works for me!
>
>
>

I gave this some more thought.  Here's some issues I came up with:

1) BlobBuilder -> FileBuilder

This renaming seems to suggest the creation of a file, which is not the
intent at all.


2) XHR.{asBlob,responseBlob} -> XHR.{asFile,responseFile}

This renaming seems to suggest the creation of a file, which is not
necessary for small responses.


3) Combine Blob and File into a single File interface

This merging has the unfortunate side-effect of introducing a "name"
property for the result of a
File.slice() operation.  It also means that the result of FileBuilder and
XHR.responseFile would
have a name.


Considering the above, it seems like there is a place for Blob (or something
like it).

I can see Jonas' points about BlobReader vs. FileReader, and so I'm happy to
backpedal and go with
FileReader, FileException, and FileError, keeping Blob for cases where we
don't promise a file.

-Darin
Received on Tuesday, 31 August 2010 15:46:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:40 GMT