[Streams API] Split ReadableStream/Reader implementation according source type (JS...
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 08:07:34 +0000 (08:07 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 08:07:34 +0000 (08:07 +0000)
commit336827f5380b35101a465d6923662c29d2f1d193
tree06977067dea1ccb134951a0ed53d30b0fec5683f
parente8b5411d3aa8327f975726dccbd2cd98b861509f
[Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
https://bugs.webkit.org/show_bug.cgi?id=143130

Reviewed by Benjamin Poulain.

Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.

Current tests cover the changes.

* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
(WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
* Modules/streams/ReadableStream.h: Made createReader virtual pure.
* Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
* Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
* Modules/streams/ReadableStreamReader.h: Ditto.
* Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
* bindings/js/ReadableStreamJSSource.cpp:
(WebCore::ReadableJSStream::create):
(WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
(WebCore::ReadableJSStream::ReadableJSStream):
(WebCore::ReadableJSStreamReader::create):
(WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
* bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStream.cpp
Source/WebCore/Modules/streams/ReadableStream.h
Source/WebCore/Modules/streams/ReadableStream.idl
Source/WebCore/Modules/streams/ReadableStreamReader.cpp
Source/WebCore/Modules/streams/ReadableStreamReader.h
Source/WebCore/Modules/streams/ReadableStreamReader.idl
Source/WebCore/bindings/js/JSReadableStreamCustom.cpp
Source/WebCore/bindings/js/ReadableStreamJSSource.cpp
Source/WebCore/bindings/js/ReadableStreamJSSource.h