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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 49 from v8_utilities import (capitalize, conditional_string, cpp_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) |
52 | 52 |
53 | 53 |
54 INTERFACE_H_INCLUDES = frozenset([ | 54 INTERFACE_H_INCLUDES = frozenset([ |
| 55 'bindings/core/v8/PropertyBagTraits.h', |
55 'bindings/core/v8/ScriptWrappable.h', | 56 'bindings/core/v8/ScriptWrappable.h', |
56 'bindings/core/v8/V8Binding.h', | 57 'bindings/core/v8/V8Binding.h', |
57 'bindings/core/v8/V8DOMWrapper.h', | 58 'bindings/core/v8/V8DOMWrapper.h', |
58 'bindings/core/v8/WrapperTypeInfo.h', | 59 'bindings/core/v8/WrapperTypeInfo.h', |
59 'platform/heap/Handle.h', | 60 'platform/heap/Handle.h', |
60 ]) | 61 ]) |
61 INTERFACE_CPP_INCLUDES = frozenset([ | 62 INTERFACE_CPP_INCLUDES = frozenset([ |
62 'bindings/core/v8/ExceptionState.h', | 63 'bindings/core/v8/ExceptionState.h', |
63 'bindings/core/v8/V8DOMConfiguration.h', | 64 'bindings/core/v8/V8DOMConfiguration.h', |
64 'bindings/core/v8/V8HiddenValue.h', | 65 'bindings/core/v8/V8HiddenValue.h', |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 custom_constructors = [{ # Only needed for computing interface length | 217 custom_constructors = [{ # Only needed for computing interface length |
217 'number_of_required_arguments': | 218 'number_of_required_arguments': |
218 number_of_required_arguments(constructor), | 219 number_of_required_arguments(constructor), |
219 } for constructor in interface.custom_constructors] | 220 } for constructor in interface.custom_constructors] |
220 | 221 |
221 # [EventConstructor] | 222 # [EventConstructor] |
222 has_event_constructor = 'EventConstructor' in extended_attributes | 223 has_event_constructor = 'EventConstructor' in extended_attributes |
223 any_type_attributes = [attribute for attribute in interface.attributes | 224 any_type_attributes = [attribute for attribute in interface.attributes |
224 if attribute.idl_type.name == 'Any'] | 225 if attribute.idl_type.name == 'Any'] |
225 if has_event_constructor: | 226 if has_event_constructor: |
226 includes.add('bindings/core/v8/Dictionary.h') | 227 includes.add('bindings/core/v8/PropertyBag.h') |
227 if any_type_attributes: | 228 if any_type_attributes: |
228 includes.add('bindings/core/v8/SerializedScriptValue.h') | 229 includes.add('bindings/core/v8/SerializedScriptValue.h') |
229 | 230 |
230 # [NamedConstructor] | 231 # [NamedConstructor] |
231 named_constructor = named_constructor_context(interface) | 232 named_constructor = named_constructor_context(interface) |
232 | 233 |
233 if (constructors or custom_constructors or has_event_constructor or | 234 if (constructors or custom_constructors or has_event_constructor or |
234 named_constructor): | 235 named_constructor): |
235 includes.add('bindings/core/v8/V8ObjectConstructor.h') | 236 includes.add('bindings/core/v8/V8ObjectConstructor.h') |
236 includes.add('core/frame/LocalDOMWindow.h') | 237 includes.add('core/frame/LocalDOMWindow.h') |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 deleter = next( | 1147 deleter = next( |
1147 method | 1148 method |
1148 for method in interface.operations | 1149 for method in interface.operations |
1149 if ('deleter' in method.specials and | 1150 if ('deleter' in method.specials and |
1150 len(method.arguments) == 1 and | 1151 len(method.arguments) == 1 and |
1151 str(method.arguments[0].idl_type) == 'DOMString')) | 1152 str(method.arguments[0].idl_type) == 'DOMString')) |
1152 except StopIteration: | 1153 except StopIteration: |
1153 return None | 1154 return None |
1154 | 1155 |
1155 return property_deleter(deleter) | 1156 return property_deleter(deleter) |
OLD | NEW |