[Streams API] Implement HighWaterMark
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2015 12:37:53 +0000 (12:37 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2015 12:37:53 +0000 (12:37 +0000)
commit77edf356fc36024d98560b03fed53fe9fe634dec
tree7db2656c6cd73fc8665cf949a5354a975f38f221
parent955f8e1270c5e434c82dd3ff9e51b300e008b268
[Streams API] Implement HighWaterMark
https://bugs.webkit.org/show_bug.cgi?id=146235

Reviewed by Darin Adler.

Source/WebCore:

Retrieval of HighWaterMark parameter from arguments passed to the ReadableStream JS constructor.
Retrieval of size function callback from arguments passed to the ReadableStream JS constructor.
Calling doPull() if buffer size is below HighWaterMark.

Covered by rebased tests.

* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::pull): Adding precise check for HWM.
* Modules/streams/ReadableStream.h: Introducing hasEnoughValues.
* bindings/js/ReadableJSStream.cpp:
(WebCore::getHighWaterMark): Utility routine to get properly HWM value.
(WebCore::ReadableJSStream::create): Retrieval of HWM and size function.
(WebCore::ReadableJSStream::ReadableJSStream):
* bindings/js/ReadableJSStream.h: Adding hasEnoughValues and desiredSize prototypes.

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/streams/reference-implementation/bad-strategies-expected.txt
LayoutTests/streams/reference-implementation/readable-stream-expected.txt
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