-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Byte stream update, including reference implementation #361
Closed
Closed
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
e31cf83
Add ReadableByteStreamByobReader
tyoshino 33b4db3
One more BYOB change
tyoshino 49e2b91
More BYOB change
tyoshino 60fdeca
Replaced RangeError with TypeError, fixed call to RequestReadableByte…
tyoshino 4b03976
More work
tyoshino 60ec5f3
Reference impl of ReadableByteStream
tyoshino 2dda7e9
Some renaming, reordered PullFromReadableByteStream.* functions
tyoshino 06309a0
Don't use IterResultObject for rejection. Replace one if with assert
tyoshino 50eafbe
Remove unnecessary substitution
tyoshino 1d7c673
Add state check. Fix return position.
tyoshino a0b9daf
Typo fix. Removed unnecessary try-catch
tyoshino 189c31d
Remove unnecessary alias
tyoshino a6f3a95
Update reference impl. Spec is not synced yet
tyoshino 721d9f7
Half done
tyoshino 1696a79
Fixed bugs
tyoshino 6b45951
Reorg
tyoshino afceae3
More tests
tyoshino 6897df9
More
tyoshino 5e40178
More fix, redesign...
tyoshino db3ab8a
Tweak
tyoshino 10bd5d3
More fix
tyoshino 187172e
Refactor
tyoshino 3f7fd74
Tidy
tyoshino 09d9847
WIP Broken
tyoshino 18235da
Working
tyoshino 87f45a6
More
tyoshino a63f0a4
More
tyoshino 5a20417
Refine
tyoshino c49457a
Guard WIP
tyoshino b6ae151
WIP. Updating frequency of pullInto
tyoshino 16cb5fa
Almost fixed
tyoshino 29a4ed2
Almost again
tyoshino 1c4f531
Working!
tyoshino b04c8fd
Renaming
tyoshino c8a8917
Reorder function definitions
tyoshino a0f36e8
Working. Refactored
tyoshino 3ca35ec
Remove some variables
tyoshino 3d3717e
Replace return undefined with return
tyoshino 7d2f9b8
Remove incorrect CallPullInto
tyoshino 788aae8
More
tyoshino b626d86
Renaming
tyoshino 13f446e
Working
tyoshino 0a512da
More
tyoshino 6bd7b93
Don't check IsCallable on the pull and pullInto method until the time…
tyoshino afeede5
Use BYTES_PER_ELEMENT
tyoshino 422795d
Validate view argument of read(view) using ArrayBuffer.isView()
tyoshino 4c87a4d
Revert change on run-tests.js
tyoshino ffaea95
Refine test case descriptions
tyoshino 2bf0357
Remove unnecessary line and fix typo
tyoshino a174501
Revert removal of _controller initialization, and add a comment to ex…
tyoshino f2a9f07
Fix _closeRequested check in enqueue() and close() of ReadableByteStr…
tyoshino 186a262
Initialize _closeRequested in ReadableByteStreamController
tyoshino 18c5554
Fix typo in CallPull and add tests to verify the fix
tyoshino 14e3bbc
Use if-elses than early returns in ReadableByteStreamController.enque…
tyoshino 28cbdc8
Make the code to handle remainder bytes work
tyoshino 7b559f5
Move EnqueueInReadableByteStreamController call in respond() to simpl…
tyoshino f3be413
Remove unreached code from releaseLock() of readers
tyoshino f174dd5
Add auto release feature tests
tyoshino 67af7d5
Prefix CallPull.* functions with ReadableByteStreamController
tyoshino a8e4945
Add tests for non-callable pull/pullInto on underlying byte source
tyoshino 95cb1d5
Use call than apply
tyoshino e187dbf
Use Uint8Array for pullInto argument
tyoshino 24d5faf
Use process.nextTick to enqueue a microtask
tyoshino 6c55dbf
Fix _callPullOrPullIntoLaterIfNeeded to be set even when not inside u…
tyoshino 7db54d1
Add a suffix "Generic" to abstract operations that are shared by all …
tyoshino 719ba77
Revert change on run-tests.js again
tyoshino 48a23cd
Give shorter names to variables for controlling pull
tyoshino a4f9a28
Move asserts after FillPullIntoDescriptorFromQueue() call into the fu…
tyoshino 76bf9ec
Allow underlying byte sources without pull/pullInto implementation
tyoshino f697ea8
Add DetachArrayBuffer calls
tyoshino e5b1c9d
Rename DetachArrayBuffer to TransferArrayBuffer
tyoshino 8d263f4
Fit 120 col
tyoshino f39fa42
Reduce code duplication in PullFromReadableByteStreamInto()
tyoshino 735b773
Reorganize code in PullFromReadableByteStream to be similar to PullFr…
tyoshino 15b5d4c
Remove unnecessary CloseReadableByteStream() call in ReadableByteStre…
tyoshino b9ac65e
Reorganize InitializeReadableByteStreamReaderGeneric() and add missin…
tyoshino 9d83b77
Factor out operation on controller from CancelReadableByteStream() in…
tyoshino 0142e33
Make CancelReadableByteStreamController() clear bytes filled in _pend…
tyoshino ac98124
Factor out two functions from ReadableByteStreamController() for read…
tyoshino ed7e2b2
Just obtain reader instead of IsReadableByteStreamLocked where someth…
tyoshino 7711f9c
Add asserts to DetachReadableByteStreamReaderGeneric
tyoshino cd57295
Remove ErrorReadableByteStreamReaderGeneric
tyoshino 87ab09f
Process pending requests first when making a stream closed/errored
tyoshino 946dd41
Make the position of DetachReadableByteStreamReaderGeneric consistent…
tyoshino 6ddcdc5
Move reader type dependent code to CloseReadableByteStream
tyoshino 9ba49b1
Rename DetachReadableByteStreamReaderGeneric to ReleaseReadableByteSt…
tyoshino f6b3edd
Add accidentally removed ReleaseReadableByteStreamReaderGeneric call
tyoshino b343560
Simplify CloseReadableByteStream. Align ReleaseReadableByteStreamRead…
tyoshino cddeae7
Factor out RespondToReadRequest()
tyoshino 21728cc
Make the diff of the spec texts minimal
tyoshino bfcfa31
Remove the anchor to IsReadableByteStreamLocked as the section which …
tyoshino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Tidy
- Loading branch information
commit 3f7fd74816be1fc529acf45bc567931265978965
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just reuse the queue-with-sizes machinery already in the spec? Then you wouldn't need _totalQueuedBytes. Obviously it is less efficient, and in a real implementation we would use something like _totalQueuedBytes. But it is perhaps simpler and less work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also wondered why I didn't use it, but just remembered. The BYOB reader may consume only a part of a chunk in a queue. Since the existing queue-with-sizes machinery is designed to work chunk-wise, we need to shift, update (partially consume), and then unshift.
See
FillPullIntoDescriptorFromQueue()
.