Bug 160293 - [Streams API] Improve ReadableStreamDefaultController.h/cpp
Summary: [Streams API] Improve ReadableStreamDefaultController.h/cpp
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: 2016-07-28 07:10 PDT by Romain Bellessort
Modified: 2016-09-29 05:50 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.77 KB, patch)
2016-09-23 06:12 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (6.76 KB, patch)
2016-09-26 08:01 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (6.74 KB, patch)
2016-09-27 07:22 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (6.97 KB, patch)
2016-09-29 01:20 PDT, Romain Bellessort
no flags Details | Formatted Diff | Diff
Patch (7.08 KB, patch)
2016-09-29 03:15 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 2016-07-28 07:10:13 PDT
Following renaming of ReadableStreamController into ReadableStreamDefaultController, a number of improvements have been suggested regarding JSReadableStreamDefaultController.h/cpp in https://bugs.webkit.org/show_bug.cgi?id=160242#c3
Comment 1 Romain Bellessort 2016-09-23 06:12:30 PDT
Created attachment 289679 [details]
Patch
Comment 2 Romain Bellessort 2016-09-26 03:25:39 PDT
I made the different improvements suggested in above link. In addition, instead of having the helper jsController() to return a pointer, I made it return a reference so that there is no need to dereference it.
Comment 3 Romain Bellessort 2016-09-26 08:01:04 PDT
Created attachment 289830 [details]
Patch
Comment 4 Romain Bellessort 2016-09-27 07:22:27 PDT
Created attachment 289941 [details]
Patch
Comment 5 Romain Bellessort 2016-09-27 08:07:47 PDT
Comment on attachment 289941 [details]
Patch

Previous patch had an issue with an invalid ASSERT, which is now fixed. This ASSERT could be removed by updating the code generator (add a getter in order to return a JSFunction& after performing an assert).
Comment 6 youenn fablet 2016-09-28 08:16:45 PDT
Comment on attachment 289941 [details]
Patch

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

> Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp:74
> +    auto& state = *globalObject.globalExec();

Can we add ASSERT(globalObject.globalExec())?
Or add a globalExec() that returns a reference and does an ASSERT?
It seems this is used in several places in these files.
Comment 7 Romain Bellessort 2016-09-29 01:20:28 PDT
Created attachment 290189 [details]
Patch
Comment 8 Romain Bellessort 2016-09-29 03:15:45 PDT
Created attachment 290194 [details]
Patch
Comment 9 Romain Bellessort 2016-09-29 05:25:48 PDT
(In reply to comment #6)
> Comment on attachment 289941 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=289941&action=review
> 
> > Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp:74
> > +    auto& state = *globalObject.globalExec();
> 
> Can we add ASSERT(globalObject.globalExec())?
> Or add a globalExec() that returns a reference and does an ASSERT?
> It seems this is used in several places in these files.

I added a globalExec() helper in considered class. It performs an ASSERT and returns a reference.
Comment 10 WebKit Commit Bot 2016-09-29 05:50:38 PDT
Comment on attachment 290194 [details]
Patch

Clearing flags on attachment: 290194

Committed r206579: <http://trac.webkit.org/changeset/206579>
Comment 11 WebKit Commit Bot 2016-09-29 05:50:42 PDT
All reviewed patches have been landed.  Closing bug.