Bug 146455 - [Streams API] Remove ReadableStreamController.enqueue() custom binding
Summary: [Streams API] Remove ReadableStreamController.enqueue() custom binding
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-06-30 04:32 PDT by youenn fablet
Modified: 2015-07-02 12:28 PDT (History)
3 users (show)

See Also:


Attachments
Patch (8.05 KB, patch)
2015-06-30 09:30 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Using Default in IDL (9.15 KB, patch)
2015-07-02 07:06 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (9.12 KB, patch)
2015-07-02 11:30 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-30 04:32:52 PDT
We should remove as much ReadableStream custom binding as possible.
Comment 1 youenn fablet 2015-06-30 09:30:22 PDT
Created attachment 255824 [details]
Patch
Comment 2 youenn fablet 2015-06-30 09:34:48 PDT
Comment on attachment 255824 [details]
Patch

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

> Source/WebCore/bindings/js/ReadableJSStream.cpp:392
> +        throwVMError(&state, error());

I thought initially about doing "ec = RangeError" here.
But the same exception must be thrown and stored in the stream.
I still see some value in introducing "RangeError" for other binding code.

> Source/WebCore/bindings/js/ReadableJSStream.h:66
>      void error(JSC::ExecState&, ExceptionCode&);

I wonder whether we should rename controller methods (enqueue, error and close), in particular error() which may be misleading with m_error getter.
Comment 3 youenn fablet 2015-07-02 07:06:58 PDT
Created attachment 256008 [details]
Using Default in IDL
Comment 4 Darin Adler 2015-07-02 09:40:44 PDT
Comment on attachment 256008 [details]
Using Default in IDL

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

> Source/WebCore/bindings/js/ReadableJSStream.cpp:344
> +        throwVMError(&state, error());

This is messy. Having the same function sometimes set exceptions directly on ExecState and other times indicate the exception with an ExceptionCode is a bad idea.

> Source/WebCore/dom/ExceptionCode.h:68
> +        RangeError = 106,

If you add this new type, I think you need to add handling for it in a few places.
Comment 5 youenn fablet 2015-07-02 10:04:21 PDT
Comment on attachment 256008 [details]
Using Default in IDL

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

>> Source/WebCore/bindings/js/ReadableJSStream.cpp:344
>> +        throwVMError(&state, error());
> 
> This is messy. Having the same function sometimes set exceptions directly on ExecState and other times indicate the exception with an ExceptionCode is a bad idea.

OK

>> Source/WebCore/dom/ExceptionCode.h:68
>> +        RangeError = 106,
> 
> If you add this new type, I think you need to add handling for it in a few places.

I plan to reuse it in ReadableJSStream::create().
I will also add it in some binding places where the range message is not very meaningful.
Comment 6 youenn fablet 2015-07-02 11:30:16 PDT
Created attachment 256021 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2015-07-02 12:28:24 PDT
Comment on attachment 256021 [details]
Patch for landing

Clearing flags on attachment: 256021

Committed r186231: <http://trac.webkit.org/changeset/186231>
Comment 8 WebKit Commit Bot 2015-07-02 12:28:28 PDT
All reviewed patches have been landed.  Closing bug.