[Streams API] Update the implementation up to spec of Nov 11 2015
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 10:21:37 +0000 (10:21 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 10:21:37 +0000 (10:21 +0000)
commit9db9442dc1c33143e73d164841e90a1bd8d09fc0
tree423ab26929974f6645c95077e1d7c61777d40706
parent363facac246143384328d64e04b4516b0025e30a
[Streams API] Update the implementation up to spec of Nov 11 2015
https://bugs.webkit.org/show_bug.cgi?id=151195

Reviewed by Youenn Fablet.

Source/WebCore:

Updated the implementation of Readable and Writable Streams to the latest changes in the spec. Main changes are
the removal of the error and the state from the reader, readers are not automatically released and then minor or
style changes.

Implementation is up to date with version
https://github.com/whatwg/streams/commit/48c8a3c30ea7e76c5e4eb9f157a438dd755bcc8e.

Tests: streams/reference-implementation/readable-stream-templated.html
       streams/reference-implementation/readable-stream-reader.html

* Modules/streams/ReadableStream.js:
(getReader): Removed check for locked stream.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamReader): Removed setting @error and @state and initialized owner and owner's
reader as per spec.
(teeReadableStreamPullFunction): Added assertions.
(isReadableStreamReader): Added comment about resetting the reader owner to null instead of undefined as a means
to distinguish between not having the slot and having it unset.
(finishClosingReadableStream): Inline @closeReadableStreamReader as it is used only here now.
(readFromReadableStreamReader): Reworked the state and error to use the stream one and changed the conditions to
pull again as per spec.
(errorReadableStream): Not releasing the reader and removed the reader error and state management.
(releaseReadableStreamReader): Deleted.
(closeReadableStreamReader): Deleted.
* Modules/streams/ReadableStreamReader.js:
(cancel): Removed some checks and assertions as per spec.
(read): Added check for owner.
(releaseLock): No closing the reader and rejecting close promise and unlinking reader and owner instead.
* Modules/streams/WritableStream.js:
(abort): Style change.
* Modules/streams/WritableStreamInternals.js:
(writableStreamAdvanceQueue):
(closeWritableStream): Used @call instead of @apply.

LayoutTests:

Updated expectations.

* streams/reference-implementation/readable-stream-reader-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt:
* streams/reference-implementation/readable-stream-templated.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/streams/reference-implementation/readable-stream-reader-expected.txt
LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt
LayoutTests/streams/reference-implementation/readable-stream-templated.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStream.js
Source/WebCore/Modules/streams/ReadableStreamInternals.js
Source/WebCore/Modules/streams/ReadableStreamReader.js
Source/WebCore/Modules/streams/WritableStream.js
Source/WebCore/Modules/streams/WritableStreamInternals.js