Bug 167786 - [Readable Streams API] Implement ReadableByteStreamController enqueue()
Summary: [Readable Streams API] Implement ReadableByteStreamController enqueue()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Romain Bellessort
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-03 02:39 PST by Romain Bellessort
Modified: 2017-02-07 01:01 PST (History)
4 users (show)

See Also:


Attachments
Patch (18.56 KB, patch)
2017-02-03 05:43 PST, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (18.68 KB, patch)
2017-02-06 07:49 PST, Romain Bellessort
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Bellessort 2017-02-03 02:39:22 PST
Implement ReadableByteStreamController enqueue() method
Comment 1 Romain Bellessort 2017-02-03 05:43:02 PST
Created attachment 300525 [details]
Patch
Comment 2 Romain Bellessort 2017-02-03 08:37:47 PST
Proposed patch implements enqueue(), except regarding the step which declares that buffer should be transferred to current realm (step 7 in https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue). I wasn't sure about what should be done there and I have isolated this in a dedicated function for a follow up patch. Conceptually, I understand the transfer operation, but I don't really get how it applies here: does it consist in making the buffer data accessible only to the ReadableStream module? (and not to the context calling enqueue())
Comment 3 youenn fablet 2017-02-05 22:23:55 PST
Comment on attachment 300525 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300525&action=review

> Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:282
> +    // For the moment, simply return received buffer.

The goal is to enable transfer from one thread (worker) to another (main thread/window).
I would guess there is already support in our codebase for that.

> Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:305
> +        }

Return early here.

> Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:309
> +        @throwTypeError("ReadableByteStreamController enqueue operation has no support for BYOB reader");

Here as well.
Comment 4 Romain Bellessort 2017-02-06 07:49:02 PST
Created attachment 300722 [details]
Patch
Comment 5 Romain Bellessort 2017-02-06 09:32:23 PST
(In reply to comment #3)
> Comment on attachment 300525 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=300525&action=review
> 
> > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:282
> > +    // For the moment, simply return received buffer.
> 
> The goal is to enable transfer from one thread (worker) to another (main
> thread/window).
> I would guess there is already support in our codebase for that.

Ok, I will further investigate the codebase then.

> > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:305
> > +        }
> 
> Return early here.
> 
> > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:309
> > +        @throwTypeError("ReadableByteStreamController enqueue operation has no support for BYOB reader");
> 
> Here as well.

Fixed in new patch.
Comment 6 WebKit Commit Bot 2017-02-07 01:01:41 PST
Comment on attachment 300722 [details]
Patch

Clearing flags on attachment: 300722

Committed r211779: <http://trac.webkit.org/changeset/211779>
Comment 7 WebKit Commit Bot 2017-02-07 01:01:44 PST
All reviewed patches have been landed.  Closing bug.