| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 'is_custom_element_callbacks': is_custom_element_callbacks, | 92 'is_custom_element_callbacks': is_custom_element_callbacks, |
| 93 'is_static': is_static, | 93 'is_static': is_static, |
| 94 'name': name, | 94 'name': name, |
| 95 'number_of_arguments': len(arguments), | 95 'number_of_arguments': len(arguments), |
| 96 'number_of_required_arguments': len([ | 96 'number_of_required_arguments': len([ |
| 97 argument for argument in arguments | 97 argument for argument in arguments |
| 98 if not (argument.is_optional or argument.is_variadic)]), | 98 if not (argument.is_optional or argument.is_variadic)]), |
| 99 'number_of_required_or_variadic_arguments': len([ | 99 'number_of_required_or_variadic_arguments': len([ |
| 100 argument for argument in arguments | 100 argument for argument in arguments |
| 101 if not argument.is_optional]), | 101 if not argument.is_optional]), |
| 102 'per_context_enabled_function_name': v8_utilities.per_context_enabled_fu
nction_name(method), # [PerContextEnabled] |
| 102 'signature': signature, | 103 'signature': signature, |
| 103 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), | 104 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), |
| 104 } | 105 } |
| 105 return contents | 106 return contents |
| 106 | 107 |
| 107 | 108 |
| 108 def generate_argument(interface, method, argument, index): | 109 def generate_argument(interface, method, argument, index): |
| 109 extended_attributes = argument.extended_attributes | 110 extended_attributes = argument.extended_attributes |
| 110 idl_type = argument.idl_type | 111 idl_type = argument.idl_type |
| 111 this_cpp_value = cpp_value(interface, method, index) | 112 this_cpp_value = cpp_value(interface, method, index) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 if argument.is_variadic: | 178 if argument.is_variadic: |
| 178 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 179 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
| 179 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 180 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
| 180 if (argument.is_optional and idl_type == 'DOMString' and | 181 if (argument.is_optional and idl_type == 'DOMString' and |
| 181 extended_attributes.get('Default') == 'NullString'): | 182 extended_attributes.get('Default') == 'NullString'): |
| 182 v8_value = 'argumentOrNull(info, %s)' % index | 183 v8_value = 'argumentOrNull(info, %s)' % index |
| 183 else: | 184 else: |
| 184 v8_value = 'info[%s]' % index | 185 v8_value = 'info[%s]' % index |
| 185 return v8_types.v8_value_to_local_cpp_value( | 186 return v8_types.v8_value_to_local_cpp_value( |
| 186 idl_type, argument.extended_attributes, v8_value, name, index=index) | 187 idl_type, argument.extended_attributes, v8_value, name, index=index) |
| OLD | NEW |