Bug 143130

Summary: [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, calvaris, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Fixed memory leak
none
Patch for landing
none
Patch for landing none

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.