W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [FileAPI] createObjectURL isReusable proposal

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Sun, 29 Jan 2012 04:41:29 +0100
Message-ID: <4F24BFE9.6060908@bauglir.com>
To: public-webapps@w3.org
It's reference issue

img.src = URL.createObjectUrl(blob)
means, that you cannot GC that blob, because URL is just text 
representation of reference.
img.src = URL.createObjectUrl(blob, true)
means, that you can GC that blob, because once URL is dereferenced, it 
will not be dereferenced again (BLOB data are used just here) and unless 
there is another reference to such blob, GC can get rid of it

img.src = blob;

tells nothing about possible access to underlying data using URL identifier

Brona

On 29.1.2012 4:31, Kyle Huey wrote:
> Why though?  What stops UAs from accepting the relevant objects for 
> .src properties?
>
> - Kyle
>
> On Sat, Jan 28, 2012 at 2:47 AM, Ian Hickson <ian@hixie.ch 
> <mailto:ian@hixie.ch>> wrote:
>
>     On Sat, 28 Jan 2012, Kyle Huey wrote:
>     > On Sat, Jan 28, 2012 at 7:10 AM, Darin Fisher
>     <darin@chromium.org <mailto:darin@chromium.org>> wrote:
>     > >
>     > > I'm not sure what a concrete proposal would look like.  Maybe
>     > > Element.URL.createObjectURL or just Element.createObjectURL?
>     >
>     > Wouldn't returning an object (which can be GCd) be a better
>     solution?
>
>     The whole point of the API is that we have an object but need a
>     string (a URL).
>
Received on Sunday, 29 January 2012 03:42:05 GMT

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