| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), | 127 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), |
| 128 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings] | 128 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended
_attributes else [''], # [PerWorldBindings] |
| 129 } | 129 } |
| 130 return contents | 130 return contents |
| 131 | 131 |
| 132 | 132 |
| 133 def generate_argument(interface, method, argument, index): | 133 def generate_argument(interface, method, argument, index): |
| 134 extended_attributes = argument.extended_attributes | 134 extended_attributes = argument.extended_attributes |
| 135 idl_type = argument.idl_type | 135 idl_type = argument.idl_type |
| 136 this_cpp_value = cpp_value(interface, method, index) | 136 this_cpp_value = cpp_value(interface, method, index) |
| 137 if idl_type == 'Node': |
| 138 includes.update(['core/frame/UseCounter.h', 'V8Attr.h']) |
| 137 return { | 139 return { |
| 138 'cpp_type': v8_types.cpp_type(idl_type), | 140 'cpp_type': v8_types.cpp_type(idl_type), |
| 139 'cpp_value': this_cpp_value, | 141 'cpp_value': this_cpp_value, |
| 140 'enum_validation_expression': v8_utilities.enum_validation_expression(id
l_type), | 142 'enum_validation_expression': v8_utilities.enum_validation_expression(id
l_type), |
| 141 'has_default': 'Default' in extended_attributes, | 143 'has_default': 'Default' in extended_attributes, |
| 142 'idl_type': idl_type, | 144 'idl_type': idl_type, |
| 143 'index': index, | 145 'index': index, |
| 144 'is_clamp': 'Clamp' in extended_attributes, | 146 'is_clamp': 'Clamp' in extended_attributes, |
| 145 'is_callback_interface': v8_types.is_callback_interface(idl_type), | 147 'is_callback_interface': v8_types.is_callback_interface(idl_type), |
| 146 'is_nullable': argument.is_nullable, | 148 'is_nullable': argument.is_nullable, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 210 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
| 209 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 211 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
| 210 # [Default=NullString] | 212 # [Default=NullString] |
| 211 if (argument.is_optional and idl_type == 'DOMString' and | 213 if (argument.is_optional and idl_type == 'DOMString' and |
| 212 extended_attributes.get('Default') == 'NullString'): | 214 extended_attributes.get('Default') == 'NullString'): |
| 213 v8_value = 'argumentOrNull(info, %s)' % index | 215 v8_value = 'argumentOrNull(info, %s)' % index |
| 214 else: | 216 else: |
| 215 v8_value = 'info[%s]' % index | 217 v8_value = 'info[%s]' % index |
| 216 return v8_types.v8_value_to_local_cpp_value( | 218 return v8_types.v8_value_to_local_cpp_value( |
| 217 idl_type, argument.extended_attributes, v8_value, name, index=index) | 219 idl_type, argument.extended_attributes, v8_value, name, index=index) |
| OLD | NEW |