| 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 28 matching lines...) Expand all Loading... |
| 39 import idl_definitions | 39 import idl_definitions |
| 40 from idl_definitions import IdlOperation | 40 from idl_definitions import IdlOperation |
| 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 capitalize, conditional_string, cpp_name, gc_type, has_
extended_attribute_value, runtime_enabled_function_name | 49 from v8_utilities import (capitalize, conditional_string, cpp_name, gc_type, |
| 50 has_extended_attribute_value, runtime_enabled_function
_name, |
| 51 extended_attribute_value_as_list) |
| 50 | 52 |
| 51 | 53 |
| 52 INTERFACE_H_INCLUDES = frozenset([ | 54 INTERFACE_H_INCLUDES = frozenset([ |
| 53 'bindings/core/v8/ScriptWrappable.h', | 55 'bindings/core/v8/ScriptWrappable.h', |
| 54 'bindings/core/v8/V8Binding.h', | 56 'bindings/core/v8/V8Binding.h', |
| 55 'bindings/core/v8/V8DOMWrapper.h', | 57 'bindings/core/v8/V8DOMWrapper.h', |
| 56 'bindings/core/v8/WrapperTypeInfo.h', | 58 'bindings/core/v8/WrapperTypeInfo.h', |
| 57 'platform/heap/Handle.h', | 59 'platform/heap/Handle.h', |
| 58 ]) | 60 ]) |
| 59 INTERFACE_CPP_INCLUDES = frozenset([ | 61 INTERFACE_CPP_INCLUDES = frozenset([ |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 # Raw pointers faster though, and NodeFilter hacky anyway. | 123 # Raw pointers faster though, and NodeFilter hacky anyway. |
| 122 'cpp_type': argument.idl_type.implemented_as + '*', | 124 'cpp_type': argument.idl_type.implemented_as + '*', |
| 123 'idl_type': argument.idl_type, | 125 'idl_type': argument.idl_type, |
| 124 'v8_type': v8_types.v8_type(argument.idl_type.name), | 126 'v8_type': v8_types.v8_type(argument.idl_type.name), |
| 125 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] | 127 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] |
| 126 for set_wrapper_reference_to in set_wrapper_reference_to_list: | 128 for set_wrapper_reference_to in set_wrapper_reference_to_list: |
| 127 set_wrapper_reference_to['idl_type'].add_includes_for_type() | 129 set_wrapper_reference_to['idl_type'].add_includes_for_type() |
| 128 | 130 |
| 129 # [SpecialWrapFor] | 131 # [SpecialWrapFor] |
| 130 if 'SpecialWrapFor' in extended_attributes: | 132 if 'SpecialWrapFor' in extended_attributes: |
| 131 special_wrap_for = extended_attributes['SpecialWrapFor'].split('|') | 133 special_wrap_for = extended_attribute_value_as_list(interface, 'SpecialW
rapFor') |
| 132 else: | 134 else: |
| 133 special_wrap_for = [] | 135 special_wrap_for = [] |
| 134 for special_wrap_interface in special_wrap_for: | 136 for special_wrap_interface in special_wrap_for: |
| 135 v8_types.add_includes_for_interface(special_wrap_interface) | 137 v8_types.add_includes_for_interface(special_wrap_interface) |
| 136 | 138 |
| 137 # [Custom=Wrap], [SetWrapperReferenceFrom] | 139 # [Custom=Wrap], [SetWrapperReferenceFrom] |
| 138 has_visit_dom_wrapper = ( | 140 has_visit_dom_wrapper = ( |
| 139 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or | 141 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or |
| 140 reachable_node_function or | 142 reachable_node_function or |
| 141 set_wrapper_reference_to_list) | 143 set_wrapper_reference_to_list) |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 deleter = next( | 1116 deleter = next( |
| 1115 method | 1117 method |
| 1116 for method in interface.operations | 1118 for method in interface.operations |
| 1117 if ('deleter' in method.specials and | 1119 if ('deleter' in method.specials and |
| 1118 len(method.arguments) == 1 and | 1120 len(method.arguments) == 1 and |
| 1119 str(method.arguments[0].idl_type) == 'DOMString')) | 1121 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1120 except StopIteration: | 1122 except StopIteration: |
| 1121 return None | 1123 return None |
| 1122 | 1124 |
| 1123 return property_deleter(deleter) | 1125 return property_deleter(deleter) |
| OLD | NEW |