WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
157235
Stop using old-style string-based enums in Internals.idl
https://bugs.webkit.org/show_bug.cgi?id=157235
Summary
Stop using old-style string-based enums in Internals.idl
Darin Adler
Reported
2016-04-30 12:19:44 PDT
Stop using old-style string-based enums in Internals.idl
Attachments
Patch
(56.99 KB, patch)
2016-04-30 12:36 PDT
,
Darin Adler
cdumez
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2016-04-30 12:36:51 PDT
Created
attachment 277823
[details]
Patch
Chris Dumez
Comment 2
2016-04-30 12:49:16 PDT
Comment on
attachment 277823
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277823&action=review
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:-3897 > - if (!$function->signature->extendedAttributes->{"Custom"} && GetNativeType($function->signature->type) ne "bool") {
How about this check? I don't think we support generating callbacks whose return value is not bool. That said, the compile assert is not great. Maybe this should be a "die" statement in the script. I think it is important to let the developer know they need to use [Custom] in this case.
> Source/WebCore/testing/Internals.cpp:2945 > +void Internals::sendMediaControlEvent(MediControlEvent event)
Typo: Media
Darin Adler
Comment 3
2016-04-30 13:00:46 PDT
Comment on
attachment 277823
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277823&action=review
I’m also noticing that the builds seem to be failing on EWS. Will have to fix that before landing.
>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:-3897 >> - if (!$function->signature->extendedAttributes->{"Custom"} && GetNativeType($function->signature->type) ne "bool") { > > How about this check? I don't think we support generating callbacks whose return value is not bool. That said, the compile assert is not great. Maybe this should be a "die" statement in the script. I think it is important to let the developer know they need to use [Custom] in this case.
I even considered changing this to a die. Here’s why I didn’t (although I am willing to do it): Generally our bindings script gets a lot of things wrong; it supports the cases we have tested, but it doesn’t exhaustively check for all the many cases it doesn’t create correct code for. Here was a check for a specific case, but written so poorly that clearly it never did anyone any good. I assume there would be some kind of compile error anyway when we try to generate a callback with a return value other than bool. I don’t think it would make incorrect code that would happen to compile but do the wrong thing. The reason to write the "die" is to make an easier to understand error message. In my defense, the COMPILE_ASSERT wasn’t being correctly generated so it was definitely not an easy to understand message before! I don’t think my change made it worse. Once the topic becomes making good error messages that are easy to address, I realize that I don’t know how easy it is to understand messages that come from die. How easy it is to spot them in the build log, what other stuff gets dumped along with them to help pinpoint the source line of the IDL file with the error, etc.
>> Source/WebCore/testing/Internals.cpp:2945 >> +void Internals::sendMediaControlEvent(MediControlEvent event) > > Typo: Media
Oops.
Darin Adler
Comment 4
2016-04-30 13:03:18 PDT
Looks like I will have to implement [Conditional] for enumerations to fix the build.
Darin Adler
Comment 5
2016-04-30 13:26:08 PDT
Committed
r200294
: <
http://trac.webkit.org/changeset/200294
>
Chris Dumez
Comment 6
2016-04-30 14:29:16 PDT
(In reply to
comment #5
)
> Committed
r200294
: <
http://trac.webkit.org/changeset/200294
>
Looks like it broke the GTK build:
https://build.webkit.org/builders/GTK%20Linux%2032-bit%20Release/builds/60996/steps/compile-webkit/logs/stdio
Darin Adler
Comment 7
2016-04-30 14:37:46 PDT
Oh, I know how to fix that.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug