Title: [216513] trunk
Revision
216513
Author
commit-qu...@webkit.org
Date
2017-05-09 10:15:40 -0700 (Tue, 09 May 2017)

Log Message

[Readable Streams API] Enable creation of ReadableStreamBYOBReader
https://bugs.webkit.org/show_bug.cgi?id=171665

Patch by Romain Bellessort <romain.belless...@crf.canon.fr> on 2017-05-09
Reviewed by Youenn Fablet.
LayoutTests/imported/w3c:

Updated expectations.

* web-platform-tests/streams/readable-byte-streams/general-expected.txt:
* web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt:

Source/WebCore:

Enabled the creation of ReadableStreamBYOBReader.

Test: streams/readable-stream-byob-reader.html

* CMakeLists.txt: Updated to support ReadableStreamBYOBReader.
* DerivedSources.cpp: Updated to support ReadableStreamBYOBReader.
* DerivedSources.make: Updated to support ReadableStreamBYOBReader.
* Modules/streams/ReadableByteStreamInternals.js: Updated to support ReadableStreamBYOBReader.
(privateInitializeReadableStreamBYOBReader):
(isReadableStreamBYOBReader):
* Modules/streams/ReadableStream.js: Updated to support ReadableStreamBYOBReader.
(getReader):
* Modules/streams/ReadableStreamBYOBReader.idl: Added.
* Modules/streams/ReadableStreamBYOBReader.js: Added.
(cancel): To be implemented.
(read): To be implemented.
(releaseLock): To be implemented.
(closed): To be implemented.
* WebCore.xcodeproj/project.pbxproj: Updated to support ReadableStreamBYOBReader.
* bindings/js/JSDOMGlobalObject.cpp: Updated to support ReadableStreamBYOBReader.
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamPrivateConstructors.cpp: Updated to support ReadableStreamBYOBReader.
(WebCore::constructJSReadableStreamReaderGeneric):
(WebCore::constructJSReadableStreamDefaultReader):
(WebCore::constructJSReadableStreamBYOBReader):
(WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
(WebCore::createReadableStreamBYOBReaderPrivateConstructor):
* bindings/js/JSReadableStreamPrivateConstructors.h: Updated to support ReadableStreamBYOBReader.
* bindings/js/WebCoreBuiltinNames.h: Updated to support ReadableStreamBYOBReader.

LayoutTests:

Added test to check the creation of ReadableStreamBYOBReader. Also check
that created object has the right methods and properties.

* streams/readable-stream-byob-reader-expected.txt: Added.
* streams/readable-stream-byob-reader.html: Added.
* streams/readable-stream-byob-reader.js: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (216512 => 216513)


--- trunk/LayoutTests/ChangeLog	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/LayoutTests/ChangeLog	2017-05-09 17:15:40 UTC (rev 216513)
@@ -1,3 +1,17 @@
+2017-05-09  Romain Bellessort  <romain.belless...@crf.canon.fr>
+
+        [Readable Streams API] Enable creation of ReadableStreamBYOBReader
+        https://bugs.webkit.org/show_bug.cgi?id=171665
+
+        Reviewed by Youenn Fablet.
+        
+        Added test to check the creation of ReadableStreamBYOBReader. Also check
+        that created object has the right methods and properties.
+
+        * streams/readable-stream-byob-reader-expected.txt: Added.
+        * streams/readable-stream-byob-reader.html: Added.
+        * streams/readable-stream-byob-reader.js: Added.
+
 2017-05-09  Frederic Wang  <fw...@igalia.com>
 
         Print more properties in the output of scrolling trees

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (216512 => 216513)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-09 17:15:40 UTC (rev 216513)
@@ -1,3 +1,15 @@
+2017-05-09  Romain Bellessort  <romain.belless...@crf.canon.fr>
+
+        [Readable Streams API] Enable creation of ReadableStreamBYOBReader
+        https://bugs.webkit.org/show_bug.cgi?id=171665
+
+        Reviewed by Youenn Fablet.
+
+        Updated expectations.
+
+        * web-platform-tests/streams/readable-byte-streams/general-expected.txt:
+        * web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt:
+
 2017-05-08  Chris Dumez  <cdu...@apple.com>
 
         Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt (216512 => 216513)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt	2017-05-09 17:15:40 UTC (rev 216513)
@@ -1,7 +1,7 @@
 
 PASS getReader({mode: "byob"}) throws on non-bytes streams 
-FAIL ReadableStream with byte source can be constructed with no errors ReadableStreamBYOBReader is not implemented
-FAIL getReader({mode}) must perform ToString() ReadableStreamBYOBReader is not implemented
+PASS ReadableStream with byte source can be constructed with no errors 
+FAIL getReader({mode}) must perform ToString() ReadableStreamBYOBReader releaseLock() is not implemented
 PASS ReadableStream with byte source: Construct and expect start and pull being called 
 PASS ReadableStream with byte source: No automatic pull call if start doesn't finish 
 PASS ReadableStream with byte source: Construct with highWaterMark of 0 
@@ -8,66 +8,66 @@
 FAIL ReadableStream with byte source: desiredSize when closed assert_equals: after closing, desiredSize must be 0 expected 0 but got 10
 FAIL ReadableStream with byte source: desiredSize when errored assert_equals: after erroring, desiredSize must be null expected (object) null but got (number) 10
 PASS ReadableStream with byte source: getReader(), then releaseLock() 
-FAIL ReadableStream with byte source: getReader() with mode set to byob, then releaseLock() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: getReader() with mode set to byob, then releaseLock() ReadableStreamBYOBReader releaseLock() is not implemented
 PASS ReadableStream with byte source: Test that closing a stream does not release a reader automatically 
-FAIL ReadableStream with byte source: Test that closing a stream does not release a BYOB reader automatically ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Test that closing a stream does not release a BYOB reader automatically ReadableStreamBYOBReader closed is not implemented
 PASS ReadableStream with byte source: Test that erroring a stream does not release a reader automatically 
-FAIL ReadableStream with byte source: Test that erroring a stream does not release a BYOB reader automatically ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Test that erroring a stream does not release a BYOB reader automatically ReadableStreamBYOBReader closed is not implemented
 PASS ReadableStream with byte source: releaseLock() on ReadableStreamReader with pending read() must throw 
 PASS ReadableStream with byte source: Automatic pull() after start() 
 PASS ReadableStream with byte source: Automatic pull() after start() and read() 
 PASS ReadableStream with byte source: autoAllocateChunkSize 
-FAIL ReadableStream with byte source: Mix of auto allocate and BYOB promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
+FAIL ReadableStream with byte source: Mix of auto allocate and BYOB promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
 PASS ReadableStream with byte source: Automatic pull() after start() and read(view) 
 PASS ReadableStream with byte source: enqueue(), getReader(), then read() 
 PASS ReadableStream with byte source: Push source that doesn't understand pull signal 
 PASS ReadableStream with byte source: read(), but pull() function is not callable 
-FAIL ReadableStream with byte source: read(view), but pull() function is not callable ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), but pull() function is not callable ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: enqueue() with Uint16Array, getReader(), then read() 
-FAIL ReadableStream with byte source: enqueue(), read(view) partially, then read() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: enqueue(), read(view) partially, then read() ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: getReader(), enqueue(), close(), then read() 
 PASS ReadableStream with byte source: enqueue(), close(), getReader(), then read() 
 PASS ReadableStream with byte source: Respond to pull() by enqueue() 
 PASS ReadableStream with byte source: Respond to pull() by enqueue() asynchronously 
-FAIL ReadableStream with byte source: read(view), then respond() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then respond() with too big value ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() with too big value ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = not BYOB) 
-FAIL ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB) ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: getReader(), read(view), then cancel() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a smaller views ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue() 1 byte, getReader(), then read(view) with Uint16Array ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue() 3 byte, getReader(), then read(view) with 2-element Uint16Array promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
-FAIL ReadableStream with byte source: read(view) with Uint16Array on close()-d stream with 1 byte enqueue()-d must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: A stream must be errored if close()-d before fulfilling read(view) with Uint16Array ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB) ReadableStreamBYOBReader cancel() is not implemented
+FAIL ReadableStream with byte source: getReader(), read(view), then cancel() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a smaller views ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue() 1 byte, getReader(), then read(view) with Uint16Array ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue() 3 byte, getReader(), then read(view) with 2-element Uint16Array promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
+FAIL ReadableStream with byte source: read(view) with Uint16Array on close()-d stream with 1 byte enqueue()-d must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: A stream must be errored if close()-d before fulfilling read(view) with Uint16Array ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: Throw if close()-ed more than once 
 PASS ReadableStream with byte source: Throw on enqueue() after close() 
-FAIL ReadableStream with byte source: read(view), then respond() and close() in pull() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() and close() in pull() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: read() twice, then enqueue() twice 
-FAIL ReadableStream with byte source: Multiple read(view), close() and respond() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple read(view), big enqueue() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple read(view) and multiple enqueue() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with passing undefined as view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with zero-length view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with passing an empty object as view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Even read(view) with passing ArrayBufferView like object as view must fail ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Multiple read(view), close() and respond() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple read(view), big enqueue() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple read(view) and multiple enqueue() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with passing undefined as view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with zero-length view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with passing an empty object as view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Even read(view) with passing ArrayBufferView like object as view must fail ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: read() on an errored stream 
 PASS ReadableStream with byte source: read(), then error() 
-FAIL ReadableStream with byte source: read(view) on an errored stream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then error() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view) on an errored stream ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then error() ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: Throwing in pull function must error the stream 
 PASS ReadableStream with byte source: Throwing in pull in response to read() must be ignored if the stream is errored in it 
-FAIL ReadableStream with byte source: Throwing in pull in response to read(view) function must error the stream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Throwing in pull in response to read(view) must be ignored if the stream is errored in it ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader can be constructed directly ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires a ReadableStream argument ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires an unlocked ReadableStream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires a ReadableStream with type "bytes" ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Throwing in pull in response to read(view) function must error the stream ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Throwing in pull in response to read(view) must be ignored if the stream is errored in it ReadableStreamBYOBReader read() is not implemented
+PASS ReadableStreamBYOBReader can be constructed directly 
+PASS ReadableStreamBYOBReader constructor requires a ReadableStream argument 
+PASS ReadableStreamBYOBReader constructor requires an unlocked ReadableStream 
+PASS ReadableStreamBYOBReader constructor requires a ReadableStream with type "bytes" 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt (216512 => 216513)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt	2017-05-09 17:15:40 UTC (rev 216513)
@@ -1,7 +1,7 @@
 
 PASS getReader({mode: "byob"}) throws on non-bytes streams 
-FAIL ReadableStream with byte source can be constructed with no errors ReadableStreamBYOBReader is not implemented
-FAIL getReader({mode}) must perform ToString() ReadableStreamBYOBReader is not implemented
+PASS ReadableStream with byte source can be constructed with no errors 
+FAIL getReader({mode}) must perform ToString() ReadableStreamBYOBReader releaseLock() is not implemented
 PASS ReadableStream with byte source: Construct and expect start and pull being called 
 PASS ReadableStream with byte source: No automatic pull call if start doesn't finish 
 PASS ReadableStream with byte source: Construct with highWaterMark of 0 
@@ -8,66 +8,66 @@
 FAIL ReadableStream with byte source: desiredSize when closed assert_equals: after closing, desiredSize must be 0 expected 0 but got 10
 FAIL ReadableStream with byte source: desiredSize when errored assert_equals: after erroring, desiredSize must be null expected (object) null but got (number) 10
 PASS ReadableStream with byte source: getReader(), then releaseLock() 
-FAIL ReadableStream with byte source: getReader() with mode set to byob, then releaseLock() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: getReader() with mode set to byob, then releaseLock() ReadableStreamBYOBReader releaseLock() is not implemented
 PASS ReadableStream with byte source: Test that closing a stream does not release a reader automatically 
-FAIL ReadableStream with byte source: Test that closing a stream does not release a BYOB reader automatically ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Test that closing a stream does not release a BYOB reader automatically ReadableStreamBYOBReader closed is not implemented
 PASS ReadableStream with byte source: Test that erroring a stream does not release a reader automatically 
-FAIL ReadableStream with byte source: Test that erroring a stream does not release a BYOB reader automatically ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Test that erroring a stream does not release a BYOB reader automatically ReadableStreamBYOBReader closed is not implemented
 PASS ReadableStream with byte source: releaseLock() on ReadableStreamReader with pending read() must throw 
 PASS ReadableStream with byte source: Automatic pull() after start() 
 PASS ReadableStream with byte source: Automatic pull() after start() and read() 
 PASS ReadableStream with byte source: autoAllocateChunkSize 
-FAIL ReadableStream with byte source: Mix of auto allocate and BYOB promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
+FAIL ReadableStream with byte source: Mix of auto allocate and BYOB promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
 PASS ReadableStream with byte source: Automatic pull() after start() and read(view) 
 PASS ReadableStream with byte source: enqueue(), getReader(), then read() 
 PASS ReadableStream with byte source: Push source that doesn't understand pull signal 
 PASS ReadableStream with byte source: read(), but pull() function is not callable 
-FAIL ReadableStream with byte source: read(view), but pull() function is not callable ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), but pull() function is not callable ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: enqueue() with Uint16Array, getReader(), then read() 
-FAIL ReadableStream with byte source: enqueue(), read(view) partially, then read() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: enqueue(), read(view) partially, then read() ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: getReader(), enqueue(), close(), then read() 
 PASS ReadableStream with byte source: enqueue(), close(), getReader(), then read() 
 PASS ReadableStream with byte source: Respond to pull() by enqueue() 
 PASS ReadableStream with byte source: Respond to pull() by enqueue() asynchronously 
-FAIL ReadableStream with byte source: read(view), then respond() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then respond() with too big value ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() with a transferred ArrayBuffer ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() with too big value ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = not BYOB) 
-FAIL ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB) ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: getReader(), read(view), then cancel() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a smaller views ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue() 1 byte, getReader(), then read(view) with Uint16Array ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: enqueue() 3 byte, getReader(), then read(view) with 2-element Uint16Array promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader is not implemented"
-FAIL ReadableStream with byte source: read(view) with Uint16Array on close()-d stream with 1 byte enqueue()-d must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: A stream must be errored if close()-d before fulfilling read(view) with Uint16Array ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then cancel() (mode = BYOB) ReadableStreamBYOBReader cancel() is not implemented
+FAIL ReadableStream with byte source: getReader(), read(view), then cancel() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: cancel() with partially filled pending pull() request promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully covered by view ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view) ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue(), getReader(), then read(view) with a smaller views ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue() 1 byte, getReader(), then read(view) with Uint16Array ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: enqueue() 3 byte, getReader(), then read(view) with 2-element Uint16Array promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader read() is not implemented"
+FAIL ReadableStream with byte source: read(view) with Uint16Array on close()-d stream with 1 byte enqueue()-d must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: A stream must be errored if close()-d before fulfilling read(view) with Uint16Array ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: Throw if close()-ed more than once 
 PASS ReadableStream with byte source: Throw on enqueue() after close() 
-FAIL ReadableStream with byte source: read(view), then respond() and close() in pull() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view), then respond() and close() in pull() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: read() twice, then enqueue() twice 
-FAIL ReadableStream with byte source: Multiple read(view), close() and respond() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple read(view), big enqueue() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Multiple read(view) and multiple enqueue() ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with passing undefined as view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with zero-length view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view) with passing an empty object as view must fail ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Even read(view) with passing ArrayBufferView like object as view must fail ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Multiple read(view), close() and respond() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple read(view), big enqueue() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Multiple read(view) and multiple enqueue() ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with passing undefined as view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with zero-length view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view) with passing an empty object as view must fail ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Even read(view) with passing ArrayBufferView like object as view must fail ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: read() on an errored stream 
 PASS ReadableStream with byte source: read(), then error() 
-FAIL ReadableStream with byte source: read(view) on an errored stream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: read(view), then error() ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: read(view) on an errored stream ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: read(view), then error() ReadableStreamBYOBReader read() is not implemented
 PASS ReadableStream with byte source: Throwing in pull function must error the stream 
 PASS ReadableStream with byte source: Throwing in pull in response to read() must be ignored if the stream is errored in it 
-FAIL ReadableStream with byte source: Throwing in pull in response to read(view) function must error the stream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStream with byte source: Throwing in pull in response to read(view) must be ignored if the stream is errored in it ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader can be constructed directly ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires a ReadableStream argument ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires an unlocked ReadableStream ReadableStreamBYOBReader is not implemented
-FAIL ReadableStreamBYOBReader constructor requires a ReadableStream with type "bytes" ReadableStreamBYOBReader is not implemented
+FAIL ReadableStream with byte source: Throwing in pull in response to read(view) function must error the stream ReadableStreamBYOBReader read() is not implemented
+FAIL ReadableStream with byte source: Throwing in pull in response to read(view) must be ignored if the stream is errored in it ReadableStreamBYOBReader read() is not implemented
+PASS ReadableStreamBYOBReader can be constructed directly 
+PASS ReadableStreamBYOBReader constructor requires a ReadableStream argument 
+PASS ReadableStreamBYOBReader constructor requires an unlocked ReadableStream 
+PASS ReadableStreamBYOBReader constructor requires a ReadableStream with type "bytes" 
 

Added: trunk/LayoutTests/streams/readable-stream-byob-reader-expected.txt (0 => 216513)


--- trunk/LayoutTests/streams/readable-stream-byob-reader-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/streams/readable-stream-byob-reader-expected.txt	2017-05-09 17:15:40 UTC (rev 216513)
@@ -0,0 +1,10 @@
+
+PASS Getting a ReadableStreamBYOBReader should succeed 
+PASS ReadableStreamBYOBReader instances should have the correct list of properties 
+PASS Calling getReader() with a this object different from ReadableStream should throw a TypeError 
+PASS Calling getReader({ mode: 'byob' }) with a ReadableStream whose controller is a ReadableStreamDefaultController should throw a TypeError 
+PASS Getting a ReadableStreamBYOBReader should succeed 
+PASS ReadableStreamBYOBReader instances should have the correct list of properties 
+PASS Calling getReader() with a this object different from ReadableStream should throw a TypeError 
+PASS Calling getReader({ mode: 'byob' }) with a ReadableStream whose controller is a ReadableStreamDefaultController should throw a TypeError 
+

Added: trunk/LayoutTests/streams/readable-stream-byob-reader.html (0 => 216513)


--- trunk/LayoutTests/streams/readable-stream-byob-reader.html	                        (rev 0)
+++ trunk/LayoutTests/streams/readable-stream-byob-reader.html	2017-05-09 17:15:40 UTC (rev 216513)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+<script>
+'use strict';
+fetch_tests_from_worker(new Worker('readable-stream-byob-reader.js'));
+</script>

Added: trunk/LayoutTests/streams/readable-stream-byob-reader.js (0 => 216513)


--- trunk/LayoutTests/streams/readable-stream-byob-reader.js	                        (rev 0)
+++ trunk/LayoutTests/streams/readable-stream-byob-reader.js	2017-05-09 17:15:40 UTC (rev 216513)
@@ -0,0 +1,60 @@
+'use strict';
+
+if (self.importScripts) {
+    self.importScripts('../resources/testharness.js');
+}
+
+test(function() {
+    const rs = new ReadableStream({
+        type: "bytes"
+    });
+    rs.getReader({ mode: 'byob' });
+}, "Getting a ReadableStreamBYOBReader should succeed");
+
+test(() => {
+    const methods = ['cancel', 'constructor', 'read', 'releaseLock'];
+    const properties = methods.concat(['closed']).sort();
+
+    const rs = new ReadableStream({ type: "bytes" });
+    const reader = rs.getReader({ mode: 'byob' });
+
+    const proto = Object.getPrototypeOf(reader);
+
+    assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties);
+
+    for (const m of methods) {
+        const propDesc = Object.getOwnPropertyDescriptor(proto, m);
+        assert_equals(propDesc.enumerable, false, 'method should be non-enumerable');
+        assert_equals(propDesc.configurable, true, 'method should be configurable');
+        assert_equals(propDesc.writable, true, 'method should be writable');
+        assert_equals(typeof reader[m], 'function', 'should have be a method');
+    }
+
+    const closedPropDesc = Object.getOwnPropertyDescriptor(proto, 'closed');
+    assert_equals(closedPropDesc.enumerable, false, 'closed should be non-enumerable');
+    assert_equals(closedPropDesc.configurable, true, 'closed should be configurable');
+    assert_not_equals(closedPropDesc.get, undefined, 'closed should have a getter');
+    assert_equals(closedPropDesc.set, undefined, 'closed should not have a setter');
+
+    assert_equals(reader.cancel.length, 1, 'cancel has 1 parameter');
+    assert_equals(reader.constructor.length, 1, 'constructor has 1 parameter');
+    assert_equals(reader.read.length, 1, 'read has 1 parameter');
+    assert_equals(reader.releaseLock.length, 0, 'releaseLock has 0 parameter');
+
+}, 'ReadableStreamBYOBReader instances should have the correct list of properties');
+
+test(function() {
+    const rs = new ReadableStream();
+    const tmp = 12;
+    assert_throws(new TypeError("Can only call ReadableStream.getReader on instances of ReadableStream"),
+        function() { rs.getReader.apply(tmp); });
+}, "Calling getReader() with a this object different from ReadableStream should throw a TypeError");
+
+test(function() {
+    const rs = new ReadableStream();
+
+    assert_throws(new TypeError("ReadableStreamBYOBReader needs a ReadableByteStreamController"),
+        function() { rs.getReader({ mode: 'byob' }); });
+}, "Calling getReader({ mode: 'byob' }) with a ReadableStream whose controller is a ReadableStreamDefaultController should throw a TypeError");
+
+done();

Modified: trunk/Source/WebCore/CMakeLists.txt (216512 => 216513)


--- trunk/Source/WebCore/CMakeLists.txt	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-05-09 17:15:40 UTC (rev 216513)
@@ -279,6 +279,7 @@
     Modules/streams/CountQueuingStrategy.idl
     Modules/streams/ReadableByteStreamController.idl
     Modules/streams/ReadableStream.idl
+    Modules/streams/ReadableStreamBYOBReader.idl
     Modules/streams/ReadableStreamBYOBRequest.idl
     Modules/streams/ReadableStreamDefaultController.idl
     Modules/streams/ReadableStreamDefaultReader.idl
@@ -3816,6 +3817,7 @@
     ${WEBCORE_DIR}/Modules/streams/ReadableByteStreamController.js
     ${WEBCORE_DIR}/Modules/streams/ReadableByteStreamInternals.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
+    ${WEBCORE_DIR}/Modules/streams/ReadableStreamBYOBReader.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStreamBYOBRequest.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStreamDefaultController.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStreamInternals.js

Modified: trunk/Source/WebCore/ChangeLog (216512 => 216513)


--- trunk/Source/WebCore/ChangeLog	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/ChangeLog	2017-05-09 17:15:40 UTC (rev 216513)
@@ -1,3 +1,40 @@
+2017-05-09  Romain Bellessort  <romain.belless...@crf.canon.fr>
+
+        [Readable Streams API] Enable creation of ReadableStreamBYOBReader
+        https://bugs.webkit.org/show_bug.cgi?id=171665
+
+        Reviewed by Youenn Fablet.
+
+        Enabled the creation of ReadableStreamBYOBReader.
+
+        Test: streams/readable-stream-byob-reader.html
+
+        * CMakeLists.txt: Updated to support ReadableStreamBYOBReader.
+        * DerivedSources.cpp: Updated to support ReadableStreamBYOBReader.
+        * DerivedSources.make: Updated to support ReadableStreamBYOBReader.
+        * Modules/streams/ReadableByteStreamInternals.js: Updated to support ReadableStreamBYOBReader.
+        (privateInitializeReadableStreamBYOBReader):
+        (isReadableStreamBYOBReader):
+        * Modules/streams/ReadableStream.js: Updated to support ReadableStreamBYOBReader.
+        (getReader):
+        * Modules/streams/ReadableStreamBYOBReader.idl: Added.
+        * Modules/streams/ReadableStreamBYOBReader.js: Added.
+        (cancel): To be implemented.
+        (read): To be implemented.
+        (releaseLock): To be implemented.
+        (closed): To be implemented.
+        * WebCore.xcodeproj/project.pbxproj: Updated to support ReadableStreamBYOBReader.
+        * bindings/js/JSDOMGlobalObject.cpp: Updated to support ReadableStreamBYOBReader.
+        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+        * bindings/js/JSReadableStreamPrivateConstructors.cpp: Updated to support ReadableStreamBYOBReader.
+        (WebCore::constructJSReadableStreamReaderGeneric):
+        (WebCore::constructJSReadableStreamDefaultReader):
+        (WebCore::constructJSReadableStreamBYOBReader):
+        (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
+        (WebCore::createReadableStreamBYOBReaderPrivateConstructor):
+        * bindings/js/JSReadableStreamPrivateConstructors.h: Updated to support ReadableStreamBYOBReader.
+        * bindings/js/WebCoreBuiltinNames.h: Updated to support ReadableStreamBYOBReader.
+
 2017-05-09  Frederic Wang  <fw...@igalia.com>
 
         Print more properties in the output of scrolling trees

Modified: trunk/Source/WebCore/DerivedSources.cpp (216512 => 216513)


--- trunk/Source/WebCore/DerivedSources.cpp	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/DerivedSources.cpp	2017-05-09 17:15:40 UTC (rev 216513)
@@ -382,6 +382,7 @@
 #include "JSRange.cpp"
 #include "JSReadableByteStreamController.cpp"
 #include "JSReadableStream.cpp"
+#include "JSReadableStreamBYOBReader.cpp"
 #include "JSReadableStreamBYOBRequest.cpp"
 #include "JSReadableStreamDefaultController.cpp"
 #include "JSReadableStreamDefaultReader.cpp"

Modified: trunk/Source/WebCore/DerivedSources.make (216512 => 216513)


--- trunk/Source/WebCore/DerivedSources.make	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/DerivedSources.make	2017-05-09 17:15:40 UTC (rev 216513)
@@ -225,6 +225,7 @@
     $(WebCore)/Modules/streams/CountQueuingStrategy.idl \
     $(WebCore)/Modules/streams/ReadableByteStreamController.idl \
     $(WebCore)/Modules/streams/ReadableStream.idl \
+    $(WebCore)/Modules/streams/ReadableStreamBYOBReader.idl \
     $(WebCore)/Modules/streams/ReadableStreamBYOBRequest.idl \
     $(WebCore)/Modules/streams/ReadableStreamDefaultController.idl \
     $(WebCore)/Modules/streams/ReadableStreamDefaultReader.idl \
@@ -1404,6 +1405,7 @@
     $(WebCore)/Modules/streams/ReadableStreamBYOBRequest.js \
     $(WebCore)/Modules/streams/ReadableStreamDefaultController.js \
     $(WebCore)/Modules/streams/ReadableStreamInternals.js \
+    $(WebCore)/Modules/streams/ReadableStreamBYOBReader.js \
     $(WebCore)/Modules/streams/ReadableStreamDefaultReader.js \
     $(WebCore)/Modules/streams/StreamInternals.js \
     $(WebCore)/Modules/streams/WritableStream.js \

Modified: trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js (216512 => 216513)


--- trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js	2017-05-09 17:15:40 UTC (rev 216513)
@@ -26,6 +26,23 @@
 // @conditional=ENABLE(STREAMS_API)
 // @internal
 
+function privateInitializeReadableStreamBYOBReader(stream)
+{
+    "use strict";
+
+    if (!@isReadableStream(stream))
+        @throwTypeError("ReadableStreamBYOBReader needs a ReadableStream");
+    if (!@isReadableByteStreamController(stream.@readableStreamController))
+        @throwTypeError("ReadableStreamBYOBReader needs a ReadableByteStreamController");
+    if (@isReadableStreamLocked(stream))
+        @throwTypeError("ReadableStream is locked");
+
+    @readableStreamReaderGenericInitialize(this, stream);
+    this.@readIntoRequests = [];
+
+    return this;
+}
+
 function privateInitializeReadableByteStreamController(stream, underlyingByteSource, highWaterMark)
 {
     "use strict";
@@ -108,10 +125,10 @@
 {
     "use strict";
 
-    // FIXME: Since BYOBReader is not yet implemented, always return false.
-    // To be implemented at the same time as BYOBReader (see isReadableStreamDefaultReader
-    // to apply same model).
-    return false;
+    // Spec tells to return true only if reader has a readIntoRequests internal slot.
+    // However, since it is a private slot, it cannot be checked using hasOwnProperty().
+    // Since readIntoRequests is initialized with an empty array, the following test is ok.
+    return @isObject(reader) && !!reader.@readIntoRequests;
 }
 
 function readableByteStreamControllerCancel(controller, reason)

Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (216512 => 216513)


--- trunk/Source/WebCore/Modules/streams/ReadableStream.js	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js	2017-05-09 17:15:40 UTC (rev 216513)
@@ -93,14 +93,13 @@
     if (options === @undefined)
          options = { };
 
-    if (options.mode === 'byob') {
-        // FIXME: Update once ReadableByteStreamContoller and ReadableStreamBYOBReader are implemented.
-        @throwTypeError("ReadableStreamBYOBReader is not implemented");
-    }
-
     if (options.mode === @undefined)
         return new @ReadableStreamDefaultReader(this);
 
+    // String conversion is required by spec, hence double equals.
+    if (options.mode == 'byob')
+        return new @ReadableStreamBYOBReader(this);
+
     @throwRangeError("Invalid mode is specified");
 }
 

Added: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl (0 => 216513)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl	2017-05-09 17:15:40 UTC (rev 216513)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 Canon Inc.
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=STREAMS_API,
+    CustomConstructor(ReadableStream stream),
+    Exposed=(Window,Worker),
+    JSBuiltin,
+    NoInterfaceObject
+] interface ReadableStreamBYOBReader {
+    [NotEnumerable] Promise<any> read(optional any view);
+    [NotEnumerable] Promise<any> cancel(optional any reason);
+    [NotEnumerable] void releaseLock();
+
+    [NotEnumerable] readonly attribute Promise<boolean> closed;
+};

Added: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js (0 => 216513)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js	                        (rev 0)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js	2017-05-09 17:15:40 UTC (rev 216513)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2017 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(STREAMS_API)
+
+function cancel(reason)
+{
+    "use strict";
+
+    // FIXME: Implement appropriate behavior.
+    @throwTypeError("ReadableStreamBYOBReader cancel() is not implemented");
+}
+
+function read(view)
+{
+    "use strict";
+
+    // FIXME: Implement appropriate behavior.
+    @throwTypeError("ReadableStreamBYOBReader read() is not implemented");
+}
+
+function releaseLock()
+{
+    "use strict";
+
+    // FIXME: Implement appropriate behavior.
+    @throwTypeError("ReadableStreamBYOBReader releaseLock() is not implemented");
+}
+
+function closed()
+{
+    "use strict";
+
+    // FIXME: Implement appropriate behavior.
+    @throwTypeError("ReadableStreamBYOBReader closed is not implemented");
+}

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (216512 => 216513)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-05-09 17:15:40 UTC (rev 216513)
@@ -3124,6 +3124,8 @@
 		7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */; };
 		7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A50 /* JSReadableStream.h */; };
 		7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A60 /* JSWritableStream.h */; };
+		7C4C96DE1AD4483500363572 /* JSReadableStreamBYOBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96DA1AD4483500363572 /* JSReadableStreamBYOBReader.cpp */; };
+		7C4C96DF1AD4483500363572 /* JSReadableStreamBYOBReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96DB1AD4483500363572 /* JSReadableStreamBYOBReader.h */; };
 		7C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96DA1AD4483500365A50 /* JSReadableStreamDefaultReader.cpp */; };
 		7C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultReader.h */; };
 		7C4C96E31AD44ABF00365A50 /* LaunchServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9392,6 +9394,7 @@
 		419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
 		419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreBuiltinNames.h; sourceTree = "<group>"; };
 		419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
+		419FAFAD1ABABCD5005B3572 /* ReadableStreamBYOBReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamBYOBReader.idl; sourceTree = "<group>"; };
 		419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; };
 		41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
 		41A023ED1A39DB7900F722DF /* WritableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WritableStream.idl; sourceTree = "<group>"; };
@@ -11134,6 +11137,8 @@
 		7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWritableStream.cpp; sourceTree = "<group>"; };
 		7C4C96D91AD4483500365A50 /* JSReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStream.h; sourceTree = "<group>"; };
 		7C4C96D91AD4483500365A60 /* JSWritableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWritableStream.h; sourceTree = "<group>"; };
+		7C4C96DA1AD4483500363572 /* JSReadableStreamBYOBReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamBYOBReader.cpp; sourceTree = "<group>"; };
+		7C4C96DB1AD4483500363572 /* JSReadableStreamBYOBReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamBYOBReader.h; sourceTree = "<group>"; };
 		7C4C96DA1AD4483500365A50 /* JSReadableStreamDefaultReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamDefaultReader.cpp; sourceTree = "<group>"; };
 		7C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamDefaultReader.h; sourceTree = "<group>"; };
 		7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchServicesSPI.h; sourceTree = "<group>"; };
@@ -12271,6 +12276,7 @@
 		9908B0F11BCACF9100ED0F65 /* ReadableStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ReadableStreamInternals.js; sourceTree = "<group>"; };
 		9908B0F11BCACF9100ED0F75 /* WritableStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = WritableStreamInternals.js; sourceTree = "<group>"; };
 		9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ReadableByteStreamInternals.js; sourceTree = "<group>"; };
+		9908B0F21BCACF9100ED3572 /* ReadableStreamBYOBReader.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ReadableStreamBYOBReader.js; sourceTree = "<group>"; };
 		9908B0F21BCACF9100ED0F65 /* ReadableStreamDefaultReader.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ReadableStreamDefaultReader.js; sourceTree = "<group>"; };
 		9908B0F31BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteLengthQueuingStrategyBuiltins.cpp; sourceTree = "<group>"; };
 		9908B0F51BCAD07D00ED0F65 /* ByteLengthQueuingStrategyBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteLengthQueuingStrategyBuiltins.h; sourceTree = "<group>"; };
@@ -12286,6 +12292,8 @@
 		9908B0FD1BCAD07D00ED0F66 /* JSDOMBindingInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMBindingInternalsBuiltins.cpp; sourceTree = "<group>"; };
 		9908B0FD1BCAD07D00ED0F75 /* WritableStreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
 		9908B0FD1BCAD07D00ED3F64 /* ReadableByteStreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableByteStreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
+		9908B0FE1BCAD07D00ED3572 /* ReadableStreamBYOBReaderBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamBYOBReaderBuiltins.cpp; sourceTree = "<group>"; };
+		9908B0FF1BCAD07D00ED3572 /* ReadableStreamBYOBReaderBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBYOBReaderBuiltins.h; sourceTree = "<group>"; };
 		9908B0FE1BCAD07D00ED0F65 /* ReadableStreamDefaultReaderBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamDefaultReaderBuiltins.cpp; sourceTree = "<group>"; };
 		9908B0FF1BCAD07D00ED0F65 /* ReadableStreamDefaultReaderBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamDefaultReaderBuiltins.h; sourceTree = "<group>"; };
 		9920398018B95BC600B39AF9 /* UserInputBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserInputBridge.cpp; sourceTree = "<group>"; };
@@ -17704,6 +17712,8 @@
 				9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */,
 				41A023ED1A39DB7900F722CF /* ReadableStream.idl */,
 				9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */,
+				419FAFAD1ABABCD5005B3572 /* ReadableStreamBYOBReader.idl */,
+				9908B0F21BCACF9100ED3572 /* ReadableStreamBYOBReader.js */,
 				41189EF71AD8232800B95672 /* ReadableStreamBYOBRequest.idl */,
 				9908B0F01BCACF9100ED5672 /* ReadableStreamBYOBRequest.js */,
 				41189EF71AD8232800B90A0D /* ReadableStreamDefaultController.idl */,
@@ -17728,6 +17738,8 @@
 				6C4C96DB1AD4483500363F64 /* JSReadableByteStreamController.h */,
 				7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */,
 				7C4C96D91AD4483500365A50 /* JSReadableStream.h */,
+				7C4C96DA1AD4483500363572 /* JSReadableStreamBYOBReader.cpp */,
+				7C4C96DB1AD4483500363572 /* JSReadableStreamBYOBReader.h */,
 				6C4C96DA1AD4483500365672 /* JSReadableStreamBYOBRequest.cpp */,
 				6C4C96DB1AD4483500365672 /* JSReadableStreamBYOBRequest.h */,
 				6C4C96DA1AD4483500365A50 /* JSReadableStreamDefaultController.cpp */,
@@ -18787,6 +18799,8 @@
 				9B03D8061BB3110D00B73F64 /* ReadableByteStreamInternalsBuiltins.h */,
 				9908B0F91BCAD07D00ED0F65 /* ReadableStreamBuiltins.cpp */,
 				9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */,
+				9908B0FE1BCAD07D00ED3572 /* ReadableStreamBYOBReaderBuiltins.cpp */,
+				9908B0FF1BCAD07D00ED3572 /* ReadableStreamBYOBReaderBuiltins.h */,
 				9908B0FA1BCAD07D00ED0F65 /* ReadableStreamDefaultControllerBuiltins.cpp */,
 				9908B0FB1BCAD07D00ED0F65 /* ReadableStreamDefaultControllerBuiltins.h */,
 				9908B0FE1BCAD07D00ED0F65 /* ReadableStreamDefaultReaderBuiltins.cpp */,
@@ -28015,6 +28029,7 @@
 				65DF320209D1CC60000BE325 /* JSRange.h in Headers */,
 				6C4C96DF1AD4483500363F64 /* JSReadableByteStreamController.h in Headers */,
 				7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */,
+				7C4C96DF1AD4483500363572 /* JSReadableStreamBYOBReader.h in Headers */,
 				6C4C96DF1AD4483500365672 /* JSReadableStreamBYOBRequest.h in Headers */,
 				6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */,
 				7C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultReader.h in Headers */,
@@ -32002,6 +32017,7 @@
 				65DF320109D1CC60000BE325 /* JSRange.cpp in Sources */,
 				6C4C96DE1AD4483500363F64 /* JSReadableByteStreamController.cpp in Sources */,
 				7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */,
+				7C4C96DE1AD4483500363572 /* JSReadableStreamBYOBReader.cpp in Sources */,
 				6C4C96DE1AD4483500365672 /* JSReadableStreamBYOBRequest.cpp in Sources */,
 				6C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultController.cpp in Sources */,
 				7C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultReader.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (216512 => 216513)


--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2017-05-09 17:15:40 UTC (rev 216513)
@@ -114,7 +114,7 @@
     return JSValue::encode(jsBoolean(RuntimeEnabledFeatures::sharedFeatures().readableByteStreamAPIEnabled()));
 }
 #endif
-    
+
 void JSDOMGlobalObject::addBuiltinGlobals(VM& vm)
 {
     m_builtinInternalFunctions.initialize(*this);
@@ -124,11 +124,13 @@
     JSObject* privateReadableByteStreamControllerConstructor = createReadableByteStreamControllerPrivateConstructor(vm, *this);
     JSObject* privateReadableStreamBYOBRequestConstructor = createReadableStreamBYOBRequestPrivateConstructor(vm, *this);
     JSObject* privateReadableStreamDefaultReaderConstructor = createReadableStreamDefaultReaderPrivateConstructor(vm, *this);
+    JSObject* privateReadableStreamBYOBReaderConstructor = createReadableStreamBYOBReaderPrivateConstructor(vm, *this);
 
     ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultControllerConstructor->info()).get());
     ASSERT(!constructors(NoLockingNecessary).get(privateReadableByteStreamControllerConstructor->info()).get());
     ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamBYOBRequestConstructor->info()).get());
     ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultReaderConstructor->info()).get());
+    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamBYOBReaderConstructor->info()).get());
     JSC::WriteBarrier<JSC::JSObject> temp;
     {
         auto locker = lockDuringMarking(vm.heap, m_gcLock);
@@ -136,6 +138,7 @@
         constructors(locker).add(privateReadableByteStreamControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableByteStreamControllerConstructor);
         constructors(locker).add(privateReadableStreamBYOBRequestConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamBYOBRequestConstructor);
         constructors(locker).add(privateReadableStreamDefaultReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamDefaultReaderConstructor);
+        constructors(locker).add(privateReadableStreamBYOBReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamBYOBReaderConstructor);
     }
 #endif
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
@@ -162,6 +165,7 @@
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableByteStreamControllerPrivateName(), privateReadableByteStreamControllerConstructor, DontDelete | ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamBYOBRequestPrivateName(), privateReadableStreamBYOBRequestConstructor, DontDelete | ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamDefaultReaderPrivateName(), privateReadableStreamDefaultReaderConstructor, DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamBYOBReaderPrivateName(), privateReadableStreamBYOBReaderConstructor, DontDelete | ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().readableByteStreamAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isReadableByteStreamAPIEnabled), DontDelete | ReadOnly),
 #endif
 #if ENABLE(WEB_RTC)

Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (216512 => 216513)


--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp	2017-05-09 17:15:40 UTC (rev 216513)
@@ -25,6 +25,7 @@
 #include "JSDOMBuiltinConstructor.h"
 #include "JSReadableByteStreamController.h"
 #include "JSReadableStream.h"
+#include "JSReadableStreamBYOBReader.h"
 #include "JSReadableStreamBYOBRequest.h"
 #include "JSReadableStreamDefaultController.h"
 #include "JSReadableStreamDefaultReader.h"
@@ -37,7 +38,15 @@
 
 namespace WebCore {
 
-// Public JS ReadableStreamReader and ReadableStreamDefaultController constructor callbacks.
+enum class ReaderType {
+    Byob,
+    Default,
+};
+
+template <ReaderType type>
+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReaderGeneric(ExecState&);
+
+// Public JS ReadableStreamDefaultController constructor callback.
 EncodedJSValue JSC_HOST_CALL constructJSReadableStreamDefaultController(ExecState& exec)
 {
     VM& vm = exec.vm();
@@ -45,13 +54,20 @@
     return throwVMTypeError(&exec, scope, ASCIILiteral("ReadableStreamDefaultController constructor should not be called directly"));
 }
 
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamDefaultReader(ExecState& exec)
+// Public JS ReadableStreamDefaultReader and ReadableStreamBYOBReader callbacks.
+template<ReaderType type>
+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReaderGeneric(ExecState& exec)
 {
     VM& vm = exec.vm();
-    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
-    JSDOMGlobalObject& globalObject = *static_cast<JSDOMGlobalObject*>(exec.lexicalGlobalObject());
+    auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
+    auto& globalObject = *JSC::jsCast<JSDOMGlobalObject*>(exec.lexicalGlobalObject());
 
-    JSC::JSObject* constructor = JSC::asObject(globalObject.get(&exec, clientData.builtinNames().ReadableStreamDefaultReaderPrivateName()));
+    JSC::JSObject* constructor;
+    if (type == ReaderType::Byob)
+        constructor = JSC::asObject(globalObject.get(&exec, clientData.builtinNames().ReadableStreamBYOBReaderPrivateName()));
+    else
+        constructor = JSC::asObject(globalObject.get(&exec, clientData.builtinNames().ReadableStreamDefaultReaderPrivateName()));
+
     ConstructData constructData;
     ConstructType constructType = constructor->methodTable(vm)->getConstructData(constructor, constructData);
     ASSERT(constructType != ConstructType::None);
@@ -61,7 +77,17 @@
     return JSValue::encode(JSC::construct(&exec, constructor, constructType, constructData, args));
 }
 
-// Public JS ReadableByteStreamController and ReadableStreamBYOBRequest constructor callback.
+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamDefaultReader(ExecState& exec)
+{
+    return constructJSReadableStreamReaderGeneric<ReaderType::Default>(exec);
+}
+
+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamBYOBReader(ExecState& exec)
+{
+    return constructJSReadableStreamReaderGeneric<ReaderType::Byob>(exec);
+}
+
+// Public JS ReadableByteStreamController and ReadableStreamBYOBRequest constructor callbacks.
 EncodedJSValue JSC_HOST_CALL constructJSReadableByteStreamController(ExecState& exec)
 {
     VM& vm = exec.vm();
@@ -79,18 +105,21 @@
 // Private JS ReadableStreamDefaultReader and ReadableStreamDefaultController constructors.
 using JSBuiltinReadableStreamDefaultReaderPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultReader>;
 using JSBuiltinReadableStreamDefaultControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultController>;
-// Private JS ReadableByteStreamController constructor.
+// Private JS ReadableByteStreamController, ReadableStreamBYOBReader and ReadableStreamBYOBRequest constructors.
 using JSBuiltinReadableByteStreamControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableByteStreamController>;
+using JSBuiltinReadableStreamBYOBReaderPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamBYOBReader>;
 using JSBuiltinReadableStreamBYOBRequestPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamBYOBRequest>;
 
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamDefaultReaderPrivateConstructor);
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamDefaultControllerPrivateConstructor);
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableByteStreamControllerPrivateConstructor);
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamBYOBReaderPrivateConstructor);
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamBYOBRequestPrivateConstructor);
 
 template<> const ClassInfo JSBuiltinReadableStreamDefaultReaderPrivateConstructor::s_info = { "ReadableStreamDefaultReaderPrivateConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBuiltinReadableStreamDefaultReaderPrivateConstructor) };
 template<> const ClassInfo JSBuiltinReadableStreamDefaultControllerPrivateConstructor::s_info = { "ReadableStreamDefaultControllerPrivateConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBuiltinReadableStreamDefaultControllerPrivateConstructor) };
 template<> const ClassInfo JSBuiltinReadableByteStreamControllerPrivateConstructor::s_info = { "ReadableByteStreamControllerPrivateConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBuiltinReadableByteStreamControllerPrivateConstructor) };
+template<> const ClassInfo JSBuiltinReadableStreamBYOBReaderPrivateConstructor::s_info = { "ReadableStreamBYOBReaderPrivateConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBuiltinReadableStreamBYOBReaderPrivateConstructor) };
 template<> const ClassInfo JSBuiltinReadableStreamBYOBRequestPrivateConstructor::s_info = { "ReadableStreamBYOBRequestPrivateConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSBuiltinReadableStreamBYOBRequestPrivateConstructor) };
 
 template<> FunctionExecutable* JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable(JSC::VM& vm)
@@ -108,6 +137,11 @@
     return readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeGenerator(vm);
 }
 
+template<> FunctionExecutable* JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable(JSC::VM& vm)
+{
+    return readableByteStreamInternalsPrivateInitializeReadableStreamBYOBReaderCodeGenerator(vm);
+}
+
 template<> FunctionExecutable* JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable(JSC::VM& vm)
 {
     return readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeGenerator(vm);
@@ -128,6 +162,11 @@
     return JSBuiltinReadableByteStreamControllerPrivateConstructor::create(vm, JSBuiltinReadableByteStreamControllerPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
 }
 
+JSObject* createReadableStreamBYOBReaderPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
+{
+    return JSBuiltinReadableStreamBYOBReaderPrivateConstructor::create(vm, JSBuiltinReadableStreamBYOBReaderPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
+}
+
 JSObject* createReadableStreamBYOBRequestPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
 {
     return JSBuiltinReadableStreamBYOBRequestPrivateConstructor::create(vm, JSBuiltinReadableStreamBYOBRequestPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);

Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h (216512 => 216513)


--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h	2017-05-09 17:15:40 UTC (rev 216513)
@@ -33,6 +33,7 @@
 JSC::JSObject* createReadableStreamDefaultControllerPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
 
 JSC::JSObject* createReadableByteStreamControllerPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
+JSC::JSObject* createReadableStreamBYOBReaderPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
 JSC::JSObject* createReadableStreamBYOBRequestPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (216512 => 216513)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2017-05-09 17:11:27 UTC (rev 216512)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2017-05-09 17:15:40 UTC (rev 216513)
@@ -116,6 +116,7 @@
     macro(MediaStreamTrack) \
     macro(ReadableByteStreamController) \
     macro(ReadableStream) \
+    macro(ReadableStreamBYOBReader) \
     macro(ReadableStreamBYOBRequest) \
     macro(ReadableStreamDefaultController) \
     macro(ReadableStreamDefaultReader) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to