12015-06-10 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2
3 [Streams API] Implement pulling of a source by a ReadableStream
4 https://bugs.webkit.org/show_bug.cgi?id=145262
5
6 Reviewed by NOBODY (OOPS!)
7
8 Introduced abstract ReadableStream::doPull() which is overriden in ReadableJSStream.
9 Added support to call the "pull" JS callback in ReadableJSStream::doPull().
10 Added calls to pull as requested by the spec (when resolving a read callback, at start time...).
11
12 Fixed issue in ReadableStreamReader::read() (use of successCallback(JSValue()) in lieu of endCallback())
13
14 Covered by rebased tests.
15
16 * Modules/streams/ReadableStream.cpp:
17 (WebCore::ReadableStream::start): calling pull() once start.
18 (WebCore::ReadableStream::pull): calling doPull() if readableStream states requires to.
19 (WebCore::ReadableStream::read): calling pull() after resolving a read callback.
20 * Modules/streams/ReadableStream.h:
21 * Modules/streams/ReadableStreamReader.cpp:
22 (WebCore::ReadableStreamReader::read): fixed JSValue() bug.
23 * bindings/js/ReadableJSStream.cpp:
24 (WebCore::ReadableJSStream::doPull): calling of JS callback.
25 (WebCore::ReadableJSStream::checkForException): catches exception and store them.
26 (WebCore::ReadableJSStream::storeError): refactoring for checkForException.
27 (WebCore::ReadableJSStream::enqueue):
28 * bindings/js/ReadableJSStream.h:
29