Implement Blob.close().
This adds support for the close() methods to Blobs,
http://dev.w3.org/2006/webapi/FileAPI/#close-method
providing a way to explicitly release the underlying data of a Blob.
Subsequent uses of a closed Blob is required/assumed to have the
following behavior:
- the size of a closed Blob should be zero.
- Consumers of such a Blob should treat it as having
size 0 (e.g., FormData.append(), XHR.send()), and not throw.
- FileReader read operations that are underway on a Blob
being close()d should not be impacted.
- Subsequent FileReader read operations on a closed Blob
should fail with InvalidStateError.
- Slices of a closed Blob should still be usable.
- Dereferencing a blob URL that has been closed should
cause a network error, like a revoke.
In other words, closing a shared object is not a straightforward
matter.
R=kinuko@chromium.org,michaeln@chromium.org, jochen@chromium.org
BUG=157794
Review URL: https://codereview.chromium.org/157363003
git-svn-id: svn://svn.chromium.org/blink/trunk@167874 bbb929c8-8fbe-4397-9dbb-9b2b20218538
26 files changed