| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 'is_variadic': arguments and arguments[-1].is_variadic, | 116 'is_variadic': arguments and arguments[-1].is_variadic, |
| 117 'measure_as': v8_utilities.measure_as(method), # [MeasureAs] | 117 'measure_as': v8_utilities.measure_as(method), # [MeasureAs] |
| 118 'name': name, | 118 'name': name, |
| 119 'number_of_arguments': len(arguments), | 119 'number_of_arguments': len(arguments), |
| 120 'number_of_required_arguments': len([ | 120 'number_of_required_arguments': len([ |
| 121 argument for argument in arguments | 121 argument for argument in arguments |
| 122 if not (argument.is_optional or argument.is_variadic)]), | 122 if not (argument.is_optional or argument.is_variadic)]), |
| 123 'number_of_required_or_variadic_arguments': len([ | 123 'number_of_required_or_variadic_arguments': len([ |
| 124 argument for argument in arguments | 124 argument for argument in arguments |
| 125 if not argument.is_optional]), | 125 if not argument.is_optional]), |
| 126 'per_context_enabled_function_name': v8_utilities.per_context_enabled_fu
nction_name(method), # [PerContextEnabled] | 126 'per_context_enabled_function': v8_utilities.per_context_enabled_functio
n_name(method), # [PerContextEnabled] |
| 127 'property_attributes': property_attributes(method), | 127 'property_attributes': property_attributes(method), |
| 128 'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_n
ame(method), # [RuntimeEnabled] | 128 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] |
| 129 'signature': signature(), | 129 'signature': signature(), |
| 130 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), | 130 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), |
| 131 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings] | 131 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings] |
| 132 } | 132 } |
| 133 return contents | 133 return contents |
| 134 | 134 |
| 135 | 135 |
| 136 def generate_argument(interface, method, argument, index): | 136 def generate_argument(interface, method, argument, index): |
| 137 extended_attributes = argument.extended_attributes | 137 extended_attributes = argument.extended_attributes |
| 138 idl_type = argument.idl_type | 138 idl_type = argument.idl_type |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 227 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
| 228 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 228 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
| 229 # [Default=NullString] | 229 # [Default=NullString] |
| 230 if (argument.is_optional and idl_type == 'DOMString' and | 230 if (argument.is_optional and idl_type == 'DOMString' and |
| 231 extended_attributes.get('Default') == 'NullString'): | 231 extended_attributes.get('Default') == 'NullString'): |
| 232 v8_value = 'argumentOrNull(info, %s)' % index | 232 v8_value = 'argumentOrNull(info, %s)' % index |
| 233 else: | 233 else: |
| 234 v8_value = 'info[%s]' % index | 234 v8_value = 'info[%s]' % index |
| 235 return v8_types.v8_value_to_local_cpp_value( | 235 return v8_types.v8_value_to_local_cpp_value( |
| 236 idl_type, argument.extended_attributes, v8_value, name, index=index) | 236 idl_type, argument.extended_attributes, v8_value, name, index=index) |
| OLD | NEW |