Bug 172566 - [WebIDL] Do a pass of cleanup in the bindings generator
Summary: [WebIDL] Do a pass of cleanup in the bindings generator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-05-24 17:45 PDT by Sam Weinig
Modified: 2017-05-30 20:25 PDT (History)
3 users (show)

See Also:


Attachments
Patch (579.39 KB, patch)
2017-05-25 09:27 PDT, Sam Weinig
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-05-24 17:45:24 PDT
[WebIDL] Do a pass of cleanup in the bindings generator
Comment 1 Sam Weinig 2017-05-25 09:27:30 PDT
Created attachment 311228 [details]
Patch
Comment 2 Chris Dumez 2017-05-25 10:35:50 PDT
Comment on attachment 311228 [details]
Patch

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

> Source/WebCore/bindings/js/JSReadableStreamSourceCustom.cpp:42
> +    // FIXME: Why is it ok to ASSERT the argument count here?

I don't think it is OK :S
Comment 3 Sam Weinig 2017-05-25 10:40:00 PDT
Committed r217433: <http://trac.webkit.org/changeset/217433>
Comment 4 Chris Dumez 2017-05-25 10:47:53 PDT
(In reply to Chris Dumez from comment #2)
> Comment on attachment 311228 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=311228&action=review
> 
> > Source/WebCore/bindings/js/JSReadableStreamSourceCustom.cpp:42
> > +    // FIXME: Why is it ok to ASSERT the argument count here?
> 
> I don't think it is OK :S

Youenn says it is "safe" because this API is only called from internal JS, not exposed to the Web. Either way, I still think this is very unnecessarily fragile and we should do an arg count check. Right now, it is calling uncheckedArgument() and would likely crash.
Comment 5 youenn fablet 2017-05-25 10:55:44 PDT
JSReadableStreamSourceCustom start/pull is only to be called by ReadableStream implementation which will always pass a controller.
It is safe to do so and all fetch API+body as stream tests would crash if we were to have an issue there.
If you want more safety here, removing uncheckedArgument and ensuring we got a controller would be needed.
Comment 6 Radar WebKit Bug Importer 2017-05-30 20:25:11 PDT
<rdar://problem/32479796>