Code generators should support multiple values for the [CallWith=] attribute
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 01:11:32 +0000 (01:11 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 01:11:32 +0000 (01:11 +0000)
commit54f3e02a58d3ecca6bbc00aa1926d64029c4019f
treebc9a1171395ebf4199512cb0a880e2dbd0890b47
parent8b5a9356af426222979cab3241117ada1389596d
Code generators should support multiple values for the [CallWith=] attribute
https://bugs.webkit.org/show_bug.cgi?id=78224

Reviewed by Adam Barth.

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].
This patch makes a change on code generators to support it.

Test: bindings/scripts/test/TestObj.idl
No change in WebKit behavior since IDL files have not yet used [CallWith=X|Y|Z].

* bindings/scripts/CodeGenerator.pm: Modified to support [CallWith=X|Y|Z].
(ExtendedAttributeContains):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateCallWith):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateCallWith):
(GenerateFunctionCallString):

* bindings/scripts/test/TestObj.idl: Added test cases for [CallWith=X|Y|Z].

* bindings/scripts/test/CPP/WebDOMTestObj.cpp: Updated run-bindings-tests results.
(WebDOMTestObj::withScriptExecutionContextAndScriptStateAttribute):
(WebDOMTestObj::setWithScriptExecutionContextAndScriptStateAttribute):
(WebDOMTestObj::withScriptExecutionContextAndScriptStateAttributeRaises):
(WebDOMTestObj::setWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebDOMTestObj::withScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebDOMTestObj::setWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebDOMTestObj::withScriptExecutionContextAndScriptState):
(WebDOMTestObj::withScriptExecutionContextAndScriptStateObjException):
(WebDOMTestObj::withScriptExecutionContextAndScriptStateWithSpaces):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_with_script_execution_context_and_script_state):
(webkit_dom_test_obj_with_script_execution_context_and_script_state_obj_exception):
(webkit_dom_test_obj_with_script_execution_context_and_script_state_with_spaces):
(webkit_dom_test_obj_get_with_script_execution_context_and_script_state_attribute):
(webkit_dom_test_obj_set_with_script_execution_context_and_script_state_attribute):
(webkit_dom_test_obj_get_with_script_execution_context_and_script_state_attribute_raises):
(webkit_dom_test_obj_set_with_script_execution_context_and_script_state_attribute_raises):
(webkit_dom_test_obj_get_with_script_execution_context_and_script_state_with_spaces_attribute):
(webkit_dom_test_obj_set_with_script_execution_context_and_script_state_with_spaces_attribute):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj withScriptExecutionContextAndScriptStateAttribute]):
(-[DOMTestObj setWithScriptExecutionContextAndScriptStateAttribute:]):
(-[DOMTestObj withScriptExecutionContextAndScriptStateAttributeRaises]):
(-[DOMTestObj setWithScriptExecutionContextAndScriptStateAttributeRaises:]):
(-[DOMTestObj withScriptExecutionContextAndScriptStateWithSpacesAttribute]):
(-[DOMTestObj setWithScriptExecutionContextAndScriptStateWithSpacesAttribute:]):
(-[DOMTestObj withScriptExecutionContextAndScriptState]):
(-[DOMTestObj withScriptExecutionContextAndScriptStateObjException]):
(-[DOMTestObj withScriptExecutionContextAndScriptStateWithSpaces]):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrGetter):
(TestObjInternal):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateAttributeAttrSetter):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateCallback):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateObjExceptionCallback):
(WebCore::TestObjInternal::withScriptExecutionContextAndScriptStateWithSpacesCallback):
(WebCore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp