Bug 146204 - [Streams API] Implement ReadableStream js source "'cancel" callback
Summary: [Streams API] Implement ReadableStream js source "'cancel" callback
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
Depends on:
Blocks: 138967
  Show dependency treegraph
Reported: 2015-06-22 06:05 PDT by youenn fablet
Modified: 2015-06-23 04:30 PDT (History)
4 users (show)

See Also:

Patch (13.86 KB, patch)
2015-06-22 06:18 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (15.17 KB, patch)
2015-06-23 03:33 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-06-22 06:05:59 PDT
Implement step 5 and 6 of https://streams.spec.whatwg.org/#cancel-readable-stream
Comment 1 youenn fablet 2015-06-22 06:18:55 PDT
Created attachment 255346 [details]
Comment 2 Darin Adler 2015-06-22 10:01:00 PDT
Comment on attachment 255346 [details]

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

> Source/WebCore/bindings/js/ReadableJSStream.cpp:164
> +static JSFunction* createCancelResultFulfilledFunction(ExecState& exec, ReadableJSStream& jsStream)

I would name this argument “stream”, not “jsStream”. I don’t think the prefix does anything significant to help programmers understand the code.

> Source/WebCore/bindings/js/ReadableJSStream.cpp:166
> +    RefPtr<ReadableJSStream> readableStream = &jsStream;

I know we need a different name for this local, but it seems that adding the word “readable” doesn’t do much good to explain why a local variable is needed. I think protectedStream would be a better name.

> Source/WebCore/bindings/js/ReadableJSStream.cpp:185
> +    ExecState& exec= *globalObject()->globalExec();

Missing space before "=". I suggest in new code we use “state” for our ExecState& and we can keep using “exec” for ExecState*.
Comment 3 youenn fablet 2015-06-23 03:33:13 PDT
Created attachment 255403 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2015-06-23 04:30:20 PDT
Comment on attachment 255403 [details]
Patch for landing

Clearing flags on attachment: 255403

Committed r185872: <http://trac.webkit.org/changeset/185872>
Comment 5 WebKit Commit Bot 2015-06-23 04:30:24 PDT
All reviewed patches have been landed.  Closing bug.