Bug 78224 - Code generators should support multiple values for the [CallWith=] attribute
Summary: Code generators should support multiple values for the [CallWith=] attribute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 77393
  Show dependency treegraph
 
Reported: 2012-02-09 05:13 PST by Kentaro Hara
Modified: 2012-02-09 17:22 PST (History)
5 users (show)

See Also:


Attachments
Patch (74.61 KB, patch)
2012-02-09 05:29 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
rebased patch for commit (74.25 KB, patch)
2012-02-09 17:08 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-02-09 05:13:08 PST
Currently we can specify only one value for one [CallWith=], like [CallWith=ScriptExecutionContext] or [CallWith=ScriptState].

To reduce redundant IDL attributes, we are planning to support multiple values for [CallWith=], like [CallWith=ScriptExecutionContext|ScriptArguments|CallStack]. In this bug, we make a change on code generators.
Comment 1 Kentaro Hara 2012-02-09 05:29:30 PST
Created attachment 126287 [details]
Patch
Comment 2 WebKit Review Bot 2012-02-09 05:30:41 PST
Attachment 126287 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:326:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:341:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1202:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1215:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1229:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1246:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1264:  Local variables should never be PassRefPtr (see http://webkit.org/coding/RefPtr.html).  [readability/pass_ptr] [5]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:1277:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 8 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Barth 2012-02-09 11:04:59 PST
Comment on attachment 126287 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGenerator.pm:641
> +sub CallWithContains

This doesn't seem specific to CallWith.  Should we give this a more general name like "ExtendedAttributeContains" or "AttributeContains"?

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1457
>  sub GenerateCallWith

Should this function error out if there's something in the CallWith attribute that we don't understand?
Comment 4 Kentaro Hara 2012-02-09 17:08:54 PST
Created attachment 126407 [details]
rebased patch for commit
Comment 5 Kentaro Hara 2012-02-09 17:10:52 PST
(In reply to comment #3)
> (From update of attachment 126287 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126287&action=review
> 
> > Source/WebCore/bindings/scripts/CodeGenerator.pm:641
> > +sub CallWithContains
> 
> This doesn't seem specific to CallWith.  Should we give this a more general name like "ExtendedAttributeContains" or "AttributeContains"?

Makes sense. Renamed to "ExtendedAttributeContains".

> > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1457
> >  sub GenerateCallWith
> 
> Should this function error out if there's something in the CallWith attribute that we don't understand?

For now I would like to skip it. I am planning to implement "IDL attribute checker" after cleaning up all IDLs, and include the CallWith values check there.
Comment 6 Kentaro Hara 2012-02-09 17:12:05 PST
Committed r107314: <http://trac.webkit.org/changeset/107314>
Comment 7 Kentaro Hara 2012-02-09 17:22:56 PST
Comment on attachment 126287 [details]
Patch

Landed manually to avoid style check errors in generated code.