Chromium Code Reviews| Index: Source/bindings/scripts/v8_methods.py |
| diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py |
| index 7d2b9f8c2d185e24f6ce5231ec40a29d1f35be9b..e81fdcc9edb25106e8837af377caf21fcf3a5b6a 100644 |
| --- a/Source/bindings/scripts/v8_methods.py |
| +++ b/Source/bindings/scripts/v8_methods.py |
| @@ -179,6 +179,7 @@ def method_context(interface, method): |
| 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script), |
| 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSignature' in extended_attributes else 'defaultSignature', |
| 'union_arguments': idl_type.union_arguments, |
| + 'use_argument_for_return_value': idl_type.is_dictionary, |
|
haraken
2014/10/15 14:38:28
use_output_parameter_for_result ?
'argument' is a
bashi
2014/10/17 00:50:05
Done.
|
| 'use_local_result': use_local_result(method), |
| 'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value), |
| 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True), |
| @@ -266,8 +267,6 @@ def cpp_value(interface, method, number_of_arguments): |
| idl_type = argument.idl_type |
| if idl_type.name == 'EventListener': |
| return argument.name |
| - if idl_type.is_dictionary: |
| - return '*%s' % argument.name |
| if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull', |
| 'XPathNSResolver', 'XPathNSResolverOrNull']): |
| # FIXME: remove this special case |
| @@ -309,6 +308,11 @@ def cpp_value(interface, method, number_of_arguments): |
| has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))): |
| cpp_arguments.append('exceptionState') |
| + # If a method returns an IDL dictionary, the return value is passed |
| + # as an argument to impl classes. |
| + if method.idl_type and method.idl_type.is_dictionary: |
|
haraken
2014/10/15 14:38:28
Do we need the 'method.idl_type and' part?
Jens Widell
2014/10/15 15:39:17
Probably for constructors. Typically when you thin
bashi
2014/10/17 00:50:05
Yes. Similar check exists on L298.
|
| + cpp_arguments.append('cppValue') |
| + |
| if method.name == 'Constructor': |
| base_name = 'create' |
| elif method.name == 'NamedConstructor': |
| @@ -433,8 +437,7 @@ def union_arguments(idl_type): |
| def argument_default_cpp_value(argument): |
| if argument.idl_type.is_dictionary: |
| - # We always create impl objects for IDL dictionaries. |
| - return '%s::create()' % argument.idl_type.base_type |
| + return None |
| if not argument.default_value: |
| return None |
| return argument.idl_type.literal_cpp_value(argument.default_value) |