OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 def use_local_result(method): | 55 def use_local_result(method): |
56 extended_attributes = method.extended_attributes | 56 extended_attributes = method.extended_attributes |
57 idl_type = method.idl_type | 57 idl_type = method.idl_type |
58 return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or | 58 return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or |
59 'ImplementedInPrivateScript' in extended_attributes or | 59 'ImplementedInPrivateScript' in extended_attributes or |
60 'RaisesException' in extended_attributes or | 60 'RaisesException' in extended_attributes or |
61 idl_type.is_union_type or | 61 idl_type.is_union_type or |
62 idl_type.is_explicit_nullable) | 62 idl_type.is_explicit_nullable) |
63 | 63 |
64 | 64 |
65 def method_context(interface, method): | 65 def method_context(interface, method, is_visible=True): |
66 arguments = method.arguments | 66 arguments = method.arguments |
67 extended_attributes = method.extended_attributes | 67 extended_attributes = method.extended_attributes |
68 idl_type = method.idl_type | 68 idl_type = method.idl_type |
69 is_static = method.is_static | 69 is_static = method.is_static |
70 name = method.name | 70 name = method.name |
71 | 71 |
72 idl_type.add_includes_for_type() | 72 idl_type.add_includes_for_type() |
73 this_cpp_value = cpp_value(interface, method, len(arguments)) | 73 this_cpp_value = cpp_value(interface, method, len(arguments)) |
74 | 74 |
75 def function_template(): | 75 def function_template(): |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', used_in_private_script=True), | 176 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', used_in_private_script=True), |
177 'property_attributes': property_attributes(method), | 177 'property_attributes': property_attributes(method), |
178 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] | 178 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] |
179 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), | 179 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), |
180 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig
nature' in extended_attributes else 'defaultSignature', | 180 'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSig
nature' in extended_attributes else 'defaultSignature', |
181 'union_arguments': idl_type.union_arguments, | 181 'union_arguments': idl_type.union_arguments, |
182 'use_output_parameter_for_result': idl_type.is_dictionary, | 182 'use_output_parameter_for_result': idl_type.is_dictionary, |
183 'use_local_result': use_local_result(method), | 183 'use_local_result': use_local_result(method), |
184 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), | 184 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), |
185 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), | 185 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), |
| 186 'visible': is_visible, |
186 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings], | 187 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings], |
187 } | 188 } |
188 | 189 |
189 | 190 |
190 def argument_context(interface, method, argument, index): | 191 def argument_context(interface, method, argument, index): |
191 extended_attributes = argument.extended_attributes | 192 extended_attributes = argument.extended_attributes |
192 idl_type = argument.idl_type | 193 idl_type = argument.idl_type |
193 this_cpp_value = cpp_value(interface, method, index) | 194 this_cpp_value = cpp_value(interface, method, index) |
194 is_variadic_wrapper_type = argument.is_variadic and idl_type.is_wrapper_type | 195 is_variadic_wrapper_type = argument.is_variadic and idl_type.is_wrapper_type |
195 | 196 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 453 |
453 IdlOperation.returns_promise = property(method_returns_promise) | 454 IdlOperation.returns_promise = property(method_returns_promise) |
454 | 455 |
455 | 456 |
456 def argument_conversion_needs_exception_state(method, argument): | 457 def argument_conversion_needs_exception_state(method, argument): |
457 idl_type = argument.idl_type | 458 idl_type = argument.idl_type |
458 return (idl_type.v8_conversion_needs_exception_state or | 459 return (idl_type.v8_conversion_needs_exception_state or |
459 argument.is_variadic or | 460 argument.is_variadic or |
460 (method.returns_promise and (idl_type.is_string_type or | 461 (method.returns_promise and (idl_type.is_string_type or |
461 idl_type.is_enum))) | 462 idl_type.is_enum))) |
OLD | NEW |