[Streams API] Add support for chunks with customized sizes
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Jun 2015 12:39:48 +0000 (12:39 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Jun 2015 12:39:48 +0000 (12:39 +0000)
commita9cc0e081f1c3ffe12b6291bca1e4a0e8bb7c28c
tree20898d90088d114eb4275b1f4b1b77140fa81c1b
parentfe52e5d00ab1f05bbc67b88aa1633b96a44dbb6b
[Streams API] Add support for chunks with customized sizes
https://bugs.webkit.org/show_bug.cgi?id=146312

Reviewed by Darin Adler.

Source/WebCore:

Covered by rebased tests.

* bindings/js/ReadableJSStream.cpp:
(WebCore::ReadableJSStream::read): Decrement totalQueueSize with the chunk specific size.
(WebCore::ReadableJSStream::enqueue): Calls retrieveSize, enqueue chunk with its size and increment totalQueueSize.
(WebCore::ReadableJSStream::retrieveChunkSize): Calls size JS callback and convert it to double.
* bindings/js/ReadableJSStream.h:

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/streams/reference-implementation/bad-strategies-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ReadableJSStream.cpp
Source/WebCore/bindings/js/ReadableJSStream.h