Bug 142399 - ReadableStream does not not need to pass itself as callback parameter
Summary: ReadableStream does not not need to pass itself as callback parameter
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: 141160
  Show dependency treegraph
 
Reported: 2015-03-06 09:17 PST by youenn fablet
Modified: 2015-03-09 04:32 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.97 KB, patch)
2015-03-06 09:30 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (2.99 KB, patch)
2015-03-09 03:41 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-06 09:17:59 PST
The callbacks can directly retrieve it by capturing the JSReadableStream object itself.
Comment 1 youenn fablet 2015-03-06 09:30:06 PST
Created attachment 248070 [details]
Patch
Comment 2 Darin Adler 2015-03-06 15:55:32 PST
Comment on attachment 248070 [details]
Patch

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

> Source/WebCore/bindings/js/JSReadableStreamCustom.cpp:74
> +        wrapper.resolve(&impl());

What guarantees that "this" won’t be deallocated before this function gets called?

> Source/WebCore/bindings/js/JSReadableStreamCustom.cpp:92
> +        wrapper.resolve(&impl());

What guarantees that "this" won’t be deallocated before this function gets called?
Comment 3 youenn fablet 2015-03-09 03:41:13 PDT
Created attachment 248240 [details]
Patch for landing
Comment 4 youenn fablet 2015-03-09 04:20:18 PDT
(In reply to comment #2)
> Comment on attachment 248070 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248070&action=review
> 
> > Source/WebCore/bindings/js/JSReadableStreamCustom.cpp:74
> > +        wrapper.resolve(&impl());
> 
> What guarantees that "this" won’t be deallocated before this function gets
> called?
> 
> > Source/WebCore/bindings/js/JSReadableStreamCustom.cpp:92
> > +        wrapper.resolve(&impl());
> 
> What guarantees that "this" won’t be deallocated before this function gets
> called?

Good point.
It is not implemented yet.
Plan is to use ActiveDOMObject from which ReadableStream is deriving.
I filed bug 142478 for that purpose.
Comment 5 WebKit Commit Bot 2015-03-09 04:32:16 PDT
Comment on attachment 248240 [details]
Patch for landing

Clearing flags on attachment: 248240

Committed r181262: <http://trac.webkit.org/changeset/181262>
Comment 6 WebKit Commit Bot 2015-03-09 04:32:19 PDT
All reviewed patches have been landed.  Closing bug.