- From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
- Date: Mon, 30 Jan 2012 18:14:16 +0100
- To: public-webapps@w3.org
- Message-ID: <4F26CFE8.20400@bauglir.com>
-------- Original Message -------- Subject: Re: [FileAPI] createObjectURL isReusable proposal Date: Mon, 30 Jan 2012 17:51:55 +0100 From: Bronislav Klučka <Bronislav.Klucka@bauglir.com> To: Boris Zbarsky <bzbarsky@MIT.EDU> On 30.1.2012 17:29, Boris Zbarsky wrote: > On 1/30/12 11:15 AM, Bronislav Klučka wrote: >> In this case you got me... what sense does it make? If there is no >> reference to original blob or any other object using that URL, why is it >> kept? > > Because given a string there is no way to tell whether someone has a > "reference" it. > > Consider this: > > window.myStash = URL.createObjectUrl(blob).split(""); > img.src = window.myStash.join(""); > > // much later one > otherImg.src = window.myStash.join(""); > > This is a simple case, of course. The url could be stored in all > sorts of other ways, because strings are very very mungable from JS. > Sorry, of course I understand, we do not only have arbitrary string created by this method, but there can be Blob itself hanging in memory... well 3 options are here 1/ leave URL revokable (affecting blob) 2/ create something like Blob.dispose() (affecting URL) 3/ assign blob to media element (but I do not like the SRC attribute for that, and it causes issues with HTML source text) nice :) Brona
Received on Monday, 30 January 2012 17:14:55 UTC