[Bug 16952] Add a Blob.close()

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

--- Comment #13 from Arun <arun@mozilla.com> 2012-07-11 19:15:47 UTC ---
I fixed the specification based on Comment 5. 

http://www.w3.org/TR/2012/WD-FileAPI-20120712/#close-method

(In reply to comment #5)
> The spec should say that size must return 0 if the Blob is neutered (is
> consistent with ArrayBuffer). (Please specify this at #dfn-size.)

Done.

http://www.w3.org/TR/2012/WD-FileAPI-20120712/#dfn-size

> 
> I'm not happy with async reads being successful for neutered Blobs. If Blobs
> are made Transferable, and gets transfered mid-read, it would mean you have to
> make a copy anyway. I would prefer if async reads fail if the Blob gets
> neutered.

As discussed:

1. A read that is underway continues.  But this is stipulated in a Note.  I
wonder what else, if anything, has to be done to bolster this condition.

2. A read commencing on a neutered Blob throws; see for example:
http://www.w3.org/TR/2012/WD-FileAPI-20120712/#dfn-readAsText

While a neutered Blob has size 0, resulting in an empty result, I think that
throwing when reading a neutral Blob object is still useful for developers.

> 
> "dereferencing a Blob URI bound to a Blob object on which close has been called
> results in a 500 Error." this part should be made a requirement (preferably in
> the part of the spec where dereferencing a Blob URI is defined).

Done.  It's in http://www.w3.org/TR/2012/WD-FileAPI-20120712/#lifeTime

Feedback welcome before this is closed.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 11 July 2012 19:15:49 UTC