[Streams API] Turn WS states into integers and fix state initialization
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 16:51:41 +0000 (16:51 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 16:51:41 +0000 (16:51 +0000)
commit948d8aec0b691a1f9f2ac2eb745432147d6ea9b5
tree1c0a3f9aa58a6b4636f76c74ccc98115d7e467a4
parente9b8f9dd0c886a54926c0291d0d4ae6b42dc32f3
[Streams API] Turn WS states into integers and fix state initialization
https://bugs.webkit.org/show_bug.cgi?id=150667

Reviewed by Youenn Fablet.

The goal of this patch is turning the writable stream states into integers instead of strings.

First readable stream states were reworked to be shared with writable stream too, they are now just @stream*.

Next step was having writable stream using integers instead of strings and translating those integers back to
strings to be able to return them correctly with the writable stream state attribute.

The state initialization was fixed and now it is not needed to check for the state to be undefined.

Rework, no new tests needed.

* Modules/streams/ReadableStream.js:
(initializeReadableStream):
* Modules/streams/ReadableStreamController.js:
(enqueue):
(error):
(close):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamReader):
(errorReadableStream):
(cancelReadableStream):
(finishClosingReadableStream):
(closeReadableStream):
(closeReadableStreamReader):
(enqueueInReadableStream):
(readFromReadableStreamReader):
* Modules/streams/ReadableStreamReader.js:
(cancel):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(abort):
(close):
(write):
(state):
* Modules/streams/WritableStreamInternals.js:
(syncWritableStreamStateWithQueue):
(errorWritableStream):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
* bindings/js/WebCoreBuiltinNames.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStream.js
Source/WebCore/Modules/streams/ReadableStreamController.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
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/WebCoreBuiltinNames.h