[Streams API] ReadableJSStream should handle promises returned by JS source pull...
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 07:45:51 +0000 (07:45 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 07:45:51 +0000 (07:45 +0000)
commit4d351d64d9ceacf0480e0e13f8bd561a3dead2f4
treea3d04d810bdce87b46f38eb2fbbcf1df08f3bbe8
parent0f870ee7dcd8a080ba51305c911170f181b5c014
[Streams API] ReadableJSStream should handle promises returned by JS source pull callback
https://bugs.webkit.org/show_bug.cgi?id=145965

Reviewed by Darin Adler.

Source/WebCore:

Implemented asynchronous pulling.
In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
Storing whether to pull automatically when the current pull is finished.

Covered by rebased tests.

* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::pull): stores whether to pull again.
(WebCore::ReadableStream::finishPulling): called when pulling finishes.
* Modules/streams/ReadableStream.h:
* bindings/js/ReadableJSStream.cpp:
(WebCore::createPullResultFulfilledFunction): The promise resolve callback.
(WebCore::ReadableJSStream::doPull): Handling of promise.
* bindings/js/ReadableJSStream.h:

LayoutTests:

Rebasing tests and removing timeout: 50 for test that is passing..

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/streams/reference-implementation/readable-stream-expected.txt
LayoutTests/streams/reference-implementation/readable-stream.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/streams/ReadableStream.cpp
Source/WebCore/Modules/streams/ReadableStream.h
Source/WebCore/bindings/js/ReadableJSStream.cpp
Source/WebCore/bindings/js/ReadableJSStream.h