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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([ | 47 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([ |
48 'DoNotCheckSecurity', | 48 'DoNotCheckSecurity', |
49 'DoNotCheckSignature', | 49 'DoNotCheckSignature', |
50 'NotEnumerable', | 50 'NotEnumerable', |
51 'Unforgeable', | 51 'Unforgeable', |
52 ]) | 52 ]) |
53 | 53 |
54 | 54 |
55 def argument_needs_try_catch(argument, return_promise): | 55 def argument_needs_try_catch(argument, return_promise): |
56 idl_type = argument.idl_type | 56 idl_type = argument.idl_type |
57 base_type = not idl_type.native_array_element_type and idl_type.base_type | 57 base_type = idl_type.base_type |
58 | 58 |
59 return not ( | 59 return not ( |
60 # These cases are handled by separate code paths in the | 60 # These cases are handled by separate code paths in the |
61 # generate_argument() macro in Source/bindings/templates/methods.cpp. | 61 # generate_argument() macro in Source/bindings/templates/methods.cpp. |
62 idl_type.is_callback_interface or | 62 idl_type.is_callback_interface or |
63 base_type == 'SerializedScriptValue' or | 63 base_type == 'SerializedScriptValue' or |
64 (argument.is_variadic and idl_type.is_wrapper_type) or | 64 (argument.is_variadic and idl_type.is_wrapper_type) or |
65 # String and enumeration arguments converted using one of the | 65 # String and enumeration arguments converted using one of the |
66 # TOSTRING_* macros except for _PROMISE variants in | 66 # TOSTRING_* macros except for _PROMISE variants in |
67 # Source/bindings/core/v8/V8BindingMacros.h don't use a v8::TryCatch. | 67 # Source/bindings/core/v8/V8BindingMacros.h don't use a v8::TryCatch. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 'has_default': 'Default' in extended_attributes or argument.default_valu
e, | 227 'has_default': 'Default' in extended_attributes or argument.default_valu
e, |
228 'has_type_checking_interface': | 228 'has_type_checking_interface': |
229 (has_extended_attribute_value(interface, 'TypeChecking', 'Interface'
) or | 229 (has_extended_attribute_value(interface, 'TypeChecking', 'Interface'
) or |
230 has_extended_attribute_value(method, 'TypeChecking', 'Interface'))
and | 230 has_extended_attribute_value(method, 'TypeChecking', 'Interface'))
and |
231 idl_type.is_wrapper_type, | 231 idl_type.is_wrapper_type, |
232 'has_type_checking_unrestricted': | 232 'has_type_checking_unrestricted': |
233 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict
ed') or | 233 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict
ed') or |
234 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted'
)) and | 234 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted'
)) and |
235 idl_type.name in ('Float', 'Double'), | 235 idl_type.name in ('Float', 'Double'), |
236 # Dictionary is special-cased, but arrays and sequences shouldn't be | 236 # Dictionary is special-cased, but arrays and sequences shouldn't be |
237 'idl_type': not idl_type.native_array_element_type and idl_type.base_typ
e, | 237 'idl_type': idl_type.base_type, |
238 'idl_type_object': idl_type, | 238 'idl_type_object': idl_type, |
239 'index': index, | 239 'index': index, |
240 'is_clamp': 'Clamp' in extended_attributes, | 240 'is_clamp': 'Clamp' in extended_attributes, |
241 'is_callback_interface': idl_type.is_callback_interface, | 241 'is_callback_interface': idl_type.is_callback_interface, |
242 'is_nullable': idl_type.is_nullable, | 242 'is_nullable': idl_type.is_nullable, |
243 'is_optional': argument.is_optional, | 243 'is_optional': argument.is_optional, |
244 'is_variadic_wrapper_type': is_variadic_wrapper_type, | 244 'is_variadic_wrapper_type': is_variadic_wrapper_type, |
245 'is_wrapper_type': idl_type.is_wrapper_type, | 245 'is_wrapper_type': idl_type.is_wrapper_type, |
246 'name': argument.name, | 246 'name': argument.name, |
247 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( | 247 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 409 |
410 | 410 |
411 def argument_default_cpp_value(argument): | 411 def argument_default_cpp_value(argument): |
412 if not argument.default_value: | 412 if not argument.default_value: |
413 return None | 413 return None |
414 return argument.idl_type.literal_cpp_value(argument.default_value) | 414 return argument.idl_type.literal_cpp_value(argument.default_value) |
415 | 415 |
416 IdlTypeBase.union_arguments = None | 416 IdlTypeBase.union_arguments = None |
417 IdlUnionType.union_arguments = property(union_arguments) | 417 IdlUnionType.union_arguments = property(union_arguments) |
418 IdlArgument.default_cpp_value = property(argument_default_cpp_value) | 418 IdlArgument.default_cpp_value = property(argument_default_cpp_value) |
OLD | NEW |