RESOLVED FIXED Bug 162556
[Streams API] Align cancelReadableStream() with spec
https://bugs.webkit.org/show_bug.cgi?id=162556
Summary [Streams API] Align cancelReadableStream() with spec
Romain Bellessort
Reported 2016-09-26 07:10:29 PDT
cancelReadableStream() behaviour is not fully in line with spec.
Attachments
Patch (6.31 KB, patch)
2016-09-26 07:23 PDT, Romain Bellessort
no flags
Patch (8.62 KB, patch)
2016-09-27 06:11 PDT, Romain Bellessort
no flags
Romain Bellessort
Comment 1 2016-09-26 07:23:03 PDT
Romain Bellessort
Comment 2 2016-09-26 08:06:15 PDT
Uploaded patches aligns the implementation of cancelReadableStream() with spec. Latest spec in particular defines a private method "cancel" in controller. This method is initialized in privateInitializeReadableStreamDefaultController (ReadableStreamInternals.js). This is similar to what was done for the private method "pull" introduced by latest spec. The function name (cancelReadableStream) has also been modified to be aligned with spec (readableStreamCancel).
Xabier Rodríguez Calvar
Comment 3 2016-09-27 03:06:09 PDT
Comment on attachment 289827 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=289827&action=review > Source/WebCore/Modules/streams/ReadableStreamInternals.js:346 > -function cancelReadableStream(stream, reason) > +function readableStreamCancel(stream, reason) Are you planning to rename all methods? I mean not in this patch, but if you plan to rename these methods then I think we can go ahead. Otherwise I would stick to the current naming convention even when it differs from the spec one.
youenn fablet
Comment 4 2016-09-27 03:17:51 PDT
Comment on attachment 289827 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=289827&action=review > Source/WebCore/Modules/streams/ReadableStreamInternals.js:86 > + "use strict"; We will create a different function for each controller. Can we just create this function once and reuse it? Something like this.@cancel = @readableStreamDefaultControllerCancel, readableStreamDefaultControllerCancel being defined in ReadableStreamInternals.js.
Romain Bellessort
Comment 5 2016-09-27 03:22:13 PDT
(In reply to comment #3) > Comment on attachment 289827 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=289827&action=review > > > Source/WebCore/Modules/streams/ReadableStreamInternals.js:346 > > -function cancelReadableStream(stream, reason) > > +function readableStreamCancel(stream, reason) > > Are you planning to rename all methods? I mean not in this patch, but if you > plan to rename these methods then I think we can go ahead. Otherwise I would > stick to the current naming convention even when it differs from the spec > one. Yes I am planning to do so. Prior to that, I want to align behaviour of some methods that is not yet fully aligned with spec (as in this patch).
Romain Bellessort
Comment 6 2016-09-27 03:23:42 PDT
(In reply to comment #4) > Comment on attachment 289827 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=289827&action=review > > > Source/WebCore/Modules/streams/ReadableStreamInternals.js:86 > > + "use strict"; > > We will create a different function for each controller. > Can we just create this function once and reuse it? > Something like this.@cancel = @readableStreamDefaultControllerCancel, > readableStreamDefaultControllerCancel being defined in > ReadableStreamInternals.js. Ok I'll do this (and I'll do the same for the similar pull() method).
Romain Bellessort
Comment 7 2016-09-27 06:11:56 PDT
Romain Bellessort
Comment 8 2016-09-27 06:42:42 PDT
Comment on attachment 289938 [details] Patch The new patch implements the change suggested by Youenn (and applies it to the private "pull" method).
Xabier Rodríguez Calvar
Comment 9 2016-09-27 07:25:23 PDT
(In reply to comment #3) > > Source/WebCore/Modules/streams/ReadableStreamInternals.js:346 > > -function cancelReadableStream(stream, reason) > > +function readableStreamCancel(stream, reason) > > Are you planning to rename all methods? I mean not in this patch, but if you > plan to rename these methods then I think we can go ahead. Otherwise I would > stick to the current naming convention even when it differs from the spec > one. You didn't answer this :)
Romain Bellessort
Comment 10 2016-09-27 07:29:18 PDT
(In reply to comment #9) > (In reply to comment #3) > > > Source/WebCore/Modules/streams/ReadableStreamInternals.js:346 > > > -function cancelReadableStream(stream, reason) > > > +function readableStreamCancel(stream, reason) > > > > Are you planning to rename all methods? I mean not in this patch, but if you > > plan to rename these methods then I think we can go ahead. Otherwise I would > > stick to the current naming convention even when it differs from the spec > > one. > > You didn't answer this :) I replied in comment #5 :) (yes, I am planing to rename all methods) (is it better to reply to multiple comments in a single comment in such cases?)
Xabier Rodríguez Calvar
Comment 11 2016-09-28 00:01:44 PDT
(In reply to comment #10) > I replied in comment #5 :) (yes, I am planing to rename all methods) Oh, sorry, my bad, read too quickly. > (is it > better to reply to multiple comments in a single comment in such cases?) You can do as you like.
Xabier Rodríguez Calvar
Comment 12 2016-09-28 00:51:40 PDT
Comment on attachment 289938 [details] Patch Romain, I don't see you online so I won't set cq+ until you let me know on IRC.
WebKit Commit Bot
Comment 13 2016-09-28 02:20:18 PDT
Comment on attachment 289938 [details] Patch Clearing flags on attachment: 289938 Committed r206508: <http://trac.webkit.org/changeset/206508>
WebKit Commit Bot
Comment 14 2016-09-28 02:20:22 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.