Re: Blob URL Origin

On Tue, May 13, 2014 at 6:00 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> On Tue, May 13, 2014 at 10:33 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> It can't work, given how URL.origin is currently defined...  It's possible
>> that definition should change, though.
>
> We don't want new URL() to take ownership of the Blob object, so
> making new URL() reflect the origin of whoever created the uuid for
> the Blob object seems weird.

Why would it need to "take ownership of the Blob object"? First of
all, the origin of the blob: url is determined by who called
createObjectURL, not who owns the Blob instance. Hence you don't
actually need to touch the Blob instance to figure out the origin, but
rather just inspect the url itself (if we use explicit origin syntax),
or look up the origin in the internal url->Blob table (if we use
implicit origin syntax).

And even if you did somehow need to touch the Blob, the implementation
could just immediately release it before returning from the
constructor.

/ Jonas

Received on Tuesday, 13 May 2014 16:59:16 UTC