[Bug 24576] Calling URL.createObjectURL() on a closed Blob

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24576

--- Comment #24 from Arun <arun@mozilla.com> ---
(In reply to Anne from comment #22)
> So we want something that works for bug 25081 comment 6.
> 
> If a blob that is closed simply loses the reference to its underlying source
> and returns an empty byte sequence, that does not seem great for FormData as
> it would be somewhat racy. However, returning the empty byte sequence if its
> closed seems good.
> 
> Maybe blobs should have a keepalive list of objects. Then at the point where
> a FormData object (FD) is serialized, FD adds itself to the keepalive list.
> Then when FD starts reading from the blob it passes itself as a parameter to
> read and is allowed to bypass the closed check and reach the source because
> it is on the keepalive list. Then once the read completes FD removes itself
> from the list and if the blob is closed and has an empty keepalive list it
> can GC.
> 
> Does that model make sense?


After today's discussion in IRC, this model makes sense. It would be a
keepalive list of objects using a given Blob. FileReader should add itself to
the keepalive list of objects using a given Blob, too, and then remove itself.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 2 April 2014 21:01:29 UTC