| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # coding=utf-8 | 2 # coding=utf-8 |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 import idl_types | 41 import idl_types |
| 42 from idl_types import IdlType, inherits_interface | 42 from idl_types import IdlType, inherits_interface |
| 43 import v8_attributes | 43 import v8_attributes |
| 44 from v8_globals import includes | 44 from v8_globals import includes |
| 45 import v8_methods | 45 import v8_methods |
| 46 import v8_types | 46 import v8_types |
| 47 from v8_types import cpp_ptr_type, cpp_template_type | 47 from v8_types import cpp_ptr_type, cpp_template_type |
| 48 import v8_utilities | 48 import v8_utilities |
| 49 from v8_utilities import (cpp_name_or_partial, capitalize, conditional_string, c
pp_name, gc_type, | 49 from v8_utilities import (cpp_name_or_partial, capitalize, conditional_string, c
pp_name, gc_type, |
| 50 has_extended_attribute_value, runtime_enabled_function
_name, | 50 has_extended_attribute_value, runtime_enabled_function
_name, |
| 51 extended_attribute_value_as_list) | 51 extended_attribute_value_as_list, is_legacy_interface_
type_checking) |
| 52 | 52 |
| 53 | 53 |
| 54 INTERFACE_H_INCLUDES = frozenset([ | 54 INTERFACE_H_INCLUDES = frozenset([ |
| 55 'bindings/core/v8/ScriptWrappable.h', | 55 'bindings/core/v8/ScriptWrappable.h', |
| 56 'bindings/core/v8/ToV8.h', | 56 'bindings/core/v8/ToV8.h', |
| 57 'bindings/core/v8/V8Binding.h', | 57 'bindings/core/v8/V8Binding.h', |
| 58 'bindings/core/v8/V8DOMWrapper.h', | 58 'bindings/core/v8/V8DOMWrapper.h', |
| 59 'bindings/core/v8/WrapperTypeInfo.h', | 59 'bindings/core/v8/WrapperTypeInfo.h', |
| 60 'platform/heap/Handle.h', | 60 'platform/heap/Handle.h', |
| 61 ]) | 61 ]) |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 | 1268 |
| 1269 | 1269 |
| 1270 def property_setter(setter, interface): | 1270 def property_setter(setter, interface): |
| 1271 if not setter: | 1271 if not setter: |
| 1272 return None | 1272 return None |
| 1273 | 1273 |
| 1274 idl_type = setter.arguments[1].idl_type | 1274 idl_type = setter.arguments[1].idl_type |
| 1275 extended_attributes = setter.extended_attributes | 1275 extended_attributes = setter.extended_attributes |
| 1276 is_raises_exception = 'RaisesException' in extended_attributes | 1276 is_raises_exception = 'RaisesException' in extended_attributes |
| 1277 | 1277 |
| 1278 # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking] |
| 1279 has_type_checking_interface = ( |
| 1280 not is_legacy_interface_type_checking(interface, setter) and |
| 1281 idl_type.is_wrapper_type) |
| 1282 |
| 1278 return { | 1283 return { |
| 1279 'has_exception_state': (is_raises_exception or | 1284 'has_exception_state': (is_raises_exception or |
| 1280 idl_type.v8_conversion_needs_exception_state), | 1285 idl_type.v8_conversion_needs_exception_state), |
| 1281 'has_type_checking_interface': | 1286 'has_type_checking_interface': has_type_checking_interface, |
| 1282 (has_extended_attribute_value(interface, 'TypeChecking', 'Interface'
) or | |
| 1283 has_extended_attribute_value(setter, 'TypeChecking', 'Interface'))
and | |
| 1284 idl_type.is_wrapper_type, | |
| 1285 'idl_type': idl_type.base_type, | 1287 'idl_type': idl_type.base_type, |
| 1286 'is_custom': 'Custom' in extended_attributes, | 1288 'is_custom': 'Custom' in extended_attributes, |
| 1287 'is_nullable': idl_type.is_nullable, | 1289 'is_nullable': idl_type.is_nullable, |
| 1288 'is_raises_exception': is_raises_exception, | 1290 'is_raises_exception': is_raises_exception, |
| 1289 'name': cpp_name(setter), | 1291 'name': cpp_name(setter), |
| 1290 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( | 1292 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( |
| 1291 extended_attributes, 'v8Value', 'propertyValue'), | 1293 extended_attributes, 'v8Value', 'propertyValue'), |
| 1292 } | 1294 } |
| 1293 | 1295 |
| 1294 | 1296 |
| 1295 def property_deleter(deleter): | 1297 def property_deleter(deleter): |
| 1296 if not deleter: | 1298 if not deleter: |
| 1297 return None | 1299 return None |
| 1298 | 1300 |
| 1299 idl_type = deleter.idl_type | 1301 idl_type = deleter.idl_type |
| 1300 extended_attributes = deleter.extended_attributes | 1302 extended_attributes = deleter.extended_attributes |
| 1301 return { | 1303 return { |
| 1302 'is_custom': 'Custom' in extended_attributes, | 1304 'is_custom': 'Custom' in extended_attributes, |
| 1303 'is_raises_exception': 'RaisesException' in extended_attributes, | 1305 'is_raises_exception': 'RaisesException' in extended_attributes, |
| 1304 'name': cpp_name(deleter), | 1306 'name': cpp_name(deleter), |
| 1305 } | 1307 } |
| OLD | NEW |