Bug 172714 - [Readable Streams API] Implement ReadableStreamBYOBReader read()
Summary: [Readable Streams API] Implement ReadableStreamBYOBReader read()
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-05-30 07:25 PDT by Romain Bellessort
Modified: 2017-06-22 09:17 PDT (History)
7 users (show)

See Also:


Attachments
Patch (34.48 KB, patch)
2017-06-01 05:52 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (34.57 KB, patch)
2017-06-22 01:39 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (34.56 KB, patch)
2017-06-22 07:36 PDT, 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-05-30 07:25:23 PDT
Implement read() method of ReadableStreamBYOBReader.
Comment 1 Romain Bellessort 2017-06-01 05:52:06 PDT
Created attachment 311692 [details]
Patch
Comment 2 Romain Bellessort 2017-06-01 07:54:16 PDT
Comment on attachment 311692 [details]
Patch

Patch implements read() behavior. Implementation of this patch allowed to reach new code and thus revealed 2 bugs to be fixed distinctly (172716 & 172717). These 2 bugs are responsible for the remaining failures in WPT tests dedicated to readable byte streams.
Comment 3 youenn fablet 2017-06-19 09:59:59 PDT
Comment on attachment 311692 [details]
Patch

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

> Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:626
> +        elementSize = view.BYTES_PER_ELEMENT;

BYTES_PER_ELEMENT is attached to the prototype, which may be changed for the given view.
In that case, BYTES_PER_ELEMENT might be set to any value.
Given there is a FIXME below, we should also add one there I guess.
Comment 4 Romain Bellessort 2017-06-20 01:01:50 PDT
(In reply to youenn fablet from comment #3)
> Comment on attachment 311692 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=311692&action=review
> 
> > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:626
> > +        elementSize = view.BYTES_PER_ELEMENT;
> 
> BYTES_PER_ELEMENT is attached to the prototype, which may be changed for the
> given view.
> In that case, BYTES_PER_ELEMENT might be set to any value.
> Given there is a FIXME below, we should also add one there I guess.

I thought that contrary to constructor property, BYTES_PER_ELEMENT could be safely relied on as it is read-only. Is it in fact not the case?
Comment 5 youenn fablet 2017-06-21 10:52:39 PDT
(In reply to Romain Bellessort from comment #4)
> (In reply to youenn fablet from comment #3)
> > Comment on attachment 311692 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=311692&action=review
> > 
> > > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:626
> > > +        elementSize = view.BYTES_PER_ELEMENT;
> > 
> > BYTES_PER_ELEMENT is attached to the prototype, which may be changed for the
> > given view.
> > In that case, BYTES_PER_ELEMENT might be set to any value.
> > Given there is a FIXME below, we should also add one there I guess.
> 
> I thought that contrary to constructor property, BYTES_PER_ELEMENT could be
> safely relied on as it is read-only. Is it in fact not the case?

Can you try to create a view, change its prototype and set a BYTES_PER_ELEMENT property and see what would be the impact on the implementation?
Comment 6 Romain Bellessort 2017-06-22 01:30:57 PDT
(In reply to youenn fablet from comment #5)
> (In reply to Romain Bellessort from comment #4)
> > (In reply to youenn fablet from comment #3)
> > > Comment on attachment 311692 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=311692&action=review
> > > 
> > > > Source/WebCore/Modules/streams/ReadableByteStreamInternals.js:626
> > > > +        elementSize = view.BYTES_PER_ELEMENT;
> > > 
> > > BYTES_PER_ELEMENT is attached to the prototype, which may be changed for the
> > > given view.
> > > In that case, BYTES_PER_ELEMENT might be set to any value.
> > > Given there is a FIXME below, we should also add one there I guess.
> > 
> > I thought that contrary to constructor property, BYTES_PER_ELEMENT could be
> > safely relied on as it is read-only. Is it in fact not the case?
> 
> Can you try to create a view, change its prototype and set a
> BYTES_PER_ELEMENT property and see what would be the impact on the
> implementation?

You're right, this allows setting any value. I will update the patch with a FIXME.
Comment 7 Romain Bellessort 2017-06-22 01:39:20 PDT
Created attachment 313597 [details]
Patch
Comment 8 WebKit Commit Bot 2017-06-22 06:12:44 PDT
Comment on attachment 313597 [details]
Patch

Rejecting attachment 313597 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 313597, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
    -> origin/master
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 218691 = 8da38dae886bcd23bde664d88dbbe517fb30a4e2
r218692 = 385f101ebc73fc9cc38e7da16e98e09b11d22b15
r218693 = c9ce2a0e61f5f952e926419c27f98c78b04eb83d
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.

Full output: http://webkit-queues.webkit.org/results/3977787
Comment 9 Romain Bellessort 2017-06-22 07:36:16 PDT
Created attachment 313618 [details]
Patch
Comment 10 WebKit Commit Bot 2017-06-22 09:17:24 PDT
Comment on attachment 313618 [details]
Patch

Clearing flags on attachment: 313618

Committed r218701: <http://trac.webkit.org/changeset/218701>
Comment 11 WebKit Commit Bot 2017-06-22 09:17:25 PDT
All reviewed patches have been landed.  Closing bug.