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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 'idl_type': idl_type, | 145 'idl_type': idl_type, |
146 'index': index, | 146 'index': index, |
147 'is_clamp': 'Clamp' in extended_attributes, | 147 'is_clamp': 'Clamp' in extended_attributes, |
148 'is_callback_interface': v8_types.is_callback_interface(idl_type), | 148 'is_callback_interface': v8_types.is_callback_interface(idl_type), |
149 'is_nullable': argument.is_nullable, | 149 'is_nullable': argument.is_nullable, |
150 'is_optional': argument.is_optional, | 150 'is_optional': argument.is_optional, |
151 'is_strict_type_checking': 'StrictTypeChecking' in extended_attributes, | 151 'is_strict_type_checking': 'StrictTypeChecking' in extended_attributes, |
152 'is_variadic_wrapper_type': argument.is_variadic and v8_types.is_wrapper
_type(idl_type), | 152 'is_variadic_wrapper_type': argument.is_variadic and v8_types.is_wrapper
_type(idl_type), |
153 'is_wrapper_type': v8_types.is_wrapper_type(idl_type), | 153 'is_wrapper_type': v8_types.is_wrapper_type(idl_type), |
154 'name': argument.name, | 154 'name': argument.name, |
| 155 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), |
155 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), | 156 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), |
156 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind
ex), | 157 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind
ex), |
157 } | 158 } |
158 | 159 |
159 | 160 |
160 def cpp_value(interface, method, number_of_arguments): | 161 def cpp_value(interface, method, number_of_arguments): |
161 def cpp_argument(argument): | 162 def cpp_argument(argument): |
162 idl_type = argument.idl_type | 163 idl_type = argument.idl_type |
163 if (v8_types.is_callback_interface(idl_type) or | 164 if (v8_types.is_callback_interface(idl_type) or |
164 idl_type in ['NodeFilter', 'XPathNSResolver']): | 165 idl_type in ['NodeFilter', 'XPathNSResolver']): |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 221 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
221 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 222 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
222 # [Default=NullString] | 223 # [Default=NullString] |
223 if (argument.is_optional and idl_type == 'DOMString' and | 224 if (argument.is_optional and idl_type == 'DOMString' and |
224 extended_attributes.get('Default') == 'NullString'): | 225 extended_attributes.get('Default') == 'NullString'): |
225 v8_value = 'argumentOrNull(info, %s)' % index | 226 v8_value = 'argumentOrNull(info, %s)' % index |
226 else: | 227 else: |
227 v8_value = 'info[%s]' % index | 228 v8_value = 'info[%s]' % index |
228 return v8_types.v8_value_to_local_cpp_value( | 229 return v8_types.v8_value_to_local_cpp_value( |
229 idl_type, argument.extended_attributes, v8_value, name, index=index) | 230 idl_type, argument.extended_attributes, v8_value, name, index=index) |
OLD | NEW |