Bug 143130 - [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
Summary: [Streams API] Split ReadableStream/Reader implementation according source typ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-27 04:30 PDT by youenn fablet
Modified: 2015-04-03 01:08 PDT (History)
3 users (show)

See Also:


Attachments
Patch (12.17 KB, patch)
2015-03-27 07:53 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (11.81 KB, patch)
2015-03-31 04:11 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixed memory leak (11.86 KB, patch)
2015-04-02 05:25 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (11.86 KB, patch)
2015-04-03 00:14 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (11.86 KB, patch)
2015-04-03 00:15 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2015-03-27 04:30:38 PDT
It may be cleaner to wrap all JS source specific handling (errors in particular) in separate classes from the core ReadableStream/ReadableStreamReader classes.
Comment 1 youenn fablet 2015-03-27 07:53:29 PDT
Created attachment 249568 [details]
Patch
Comment 2 youenn fablet 2015-03-31 04:11:09 PDT
Created attachment 249817 [details]
Patch
Comment 3 youenn fablet 2015-04-02 05:25:42 PDT
Created attachment 249971 [details]
Fixed memory leak
Comment 4 Benjamin Poulain 2015-04-02 16:02:26 PDT
Comment on attachment 249971 [details]
Fixed memory leak

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

I am quite surprised you specialize the reader, I was expecting a subclass only for ReadableStream.

I guess ReadableJSStream and ReadableJSStreamReader will grow right? I would give them their own header.

r=me in any case, no problem with this patch.

> Source/WebCore/ChangeLog:16
> +        (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ese subclassing.

Typo: ese

> Source/WebCore/bindings/js/ReadableStreamJSSource.h:65
> +

Useless blank line here.
Comment 5 youenn fablet 2015-04-03 00:12:54 PDT
Thanks for the review.

(In reply to comment #4)
> Comment on attachment 249971 [details]
> Fixed memory leak
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249971&action=review
> 
> I am quite surprised you specialize the reader, I was expecting a subclass
> only for ReadableStream.

ReadableJSStreamReader sole purpose is to store JS errors as a JSC::Strong. 
ReadableStream does also the chunk queue management.

> I guess ReadableJSStream and ReadableJSStreamReader will grow right? I would
> give them their own header.

Yes, maybe we could move ReadableJSStream and ReadableJSStreamReader to a different file. I would keep both classes together, ReadableJSStreamReader taking only 15 lines with the error storage code.

> 
> r=me in any case, no problem with this patch.

Great!
 
> > Source/WebCore/ChangeLog:16
> > +        (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ese subclassing.
> 
> Typo: ese

OK

> 
> > Source/WebCore/bindings/js/ReadableStreamJSSource.h:65
> > +
> 
> Useless blank line here.

OK
Comment 6 youenn fablet 2015-04-03 00:14:33 PDT
Created attachment 250049 [details]
Patch for landing
Comment 7 youenn fablet 2015-04-03 00:15:43 PDT
Created attachment 250050 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2015-04-03 01:08:25 PDT
Comment on attachment 250050 [details]
Patch for landing

Clearing flags on attachment: 250050

Committed r182309: <http://trac.webkit.org/changeset/182309>
Comment 9 WebKit Commit Bot 2015-04-03 01:08:31 PDT
All reviewed patches have been landed.  Closing bug.