Bug 172566

Summary: [WebIDL] Do a pass of cleanup in the bindings generator
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch cdumez: review+

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>