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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 import v8_attributes | 38 import v8_attributes |
39 from v8_globals import includes | 39 from v8_globals import includes |
40 import v8_methods | 40 import v8_methods |
41 import v8_types | 41 import v8_types |
42 from v8_types import inherits_interface, is_interface_type | 42 from v8_types import inherits_interface, is_interface_type |
43 import v8_utilities | 43 import v8_utilities |
44 from v8_utilities import capitalize, conditional_string, cpp_name, has_extended_
attribute_value, runtime_enabled_function_name | 44 from v8_utilities import capitalize, conditional_string, cpp_name, has_extended_
attribute_value, runtime_enabled_function_name |
45 | 45 |
46 | 46 |
47 INTERFACE_H_INCLUDES = set([ | 47 INTERFACE_H_INCLUDES = frozenset([ |
48 'bindings/v8/V8Binding.h', | 48 'bindings/v8/V8Binding.h', |
49 'bindings/v8/V8DOMWrapper.h', | 49 'bindings/v8/V8DOMWrapper.h', |
50 'bindings/v8/WrapperTypeInfo.h', | 50 'bindings/v8/WrapperTypeInfo.h', |
51 'heap/Handle.h', | 51 'heap/Handle.h', |
52 ]) | 52 ]) |
53 INTERFACE_CPP_INCLUDES = set([ | 53 INTERFACE_CPP_INCLUDES = frozenset([ |
54 'RuntimeEnabledFeatures.h', | 54 'RuntimeEnabledFeatures.h', |
55 'bindings/v8/ExceptionState.h', | 55 'bindings/v8/ExceptionState.h', |
56 'bindings/v8/V8DOMConfiguration.h', | 56 'bindings/v8/V8DOMConfiguration.h', |
57 'bindings/v8/V8ObjectConstructor.h', | 57 'bindings/v8/V8ObjectConstructor.h', |
58 'core/dom/ContextFeatures.h', | 58 'core/dom/ContextFeatures.h', |
59 'core/dom/Document.h', | 59 'core/dom/Document.h', |
60 'platform/TraceEvent.h', | 60 'platform/TraceEvent.h', |
61 'wtf/GetPtr.h', # FIXME: remove if can eliminate WTF::getPtr | 61 'wtf/GetPtr.h', # FIXME: remove if can eliminate WTF::getPtr |
62 'wtf/RefPtr.h', | 62 'wtf/RefPtr.h', |
63 ]) | 63 ]) |
64 | 64 |
65 | 65 |
66 def generate_interface(interface): | 66 def generate_interface(interface): |
67 includes.clear() | 67 includes.clear() |
68 includes.update(INTERFACE_CPP_INCLUDES) | 68 includes.update(INTERFACE_CPP_INCLUDES) |
69 header_includes = INTERFACE_H_INCLUDES | 69 header_includes = set(INTERFACE_H_INCLUDES) |
70 | 70 |
71 parent_interface = interface.parent | 71 parent_interface = interface.parent |
72 if parent_interface: | 72 if parent_interface: |
73 header_includes.update(v8_types.includes_for_type(parent_interface)) | 73 header_includes.update(v8_types.includes_for_type(parent_interface)) |
74 extended_attributes = interface.extended_attributes | 74 extended_attributes = interface.extended_attributes |
75 | 75 |
76 is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer') | 76 is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer') |
77 if is_audio_buffer: | 77 if is_audio_buffer: |
78 includes.add('modules/webaudio/AudioBuffer.h') | 78 includes.add('modules/webaudio/AudioBuffer.h') |
79 | 79 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 deleter = next( | 710 deleter = next( |
711 method | 711 method |
712 for method in interface.operations | 712 for method in interface.operations |
713 if ('deleter' in method.specials and | 713 if ('deleter' in method.specials and |
714 len(method.arguments) == 1 and | 714 len(method.arguments) == 1 and |
715 method.arguments[0].idl_type == 'DOMString')) | 715 method.arguments[0].idl_type == 'DOMString')) |
716 except StopIteration: | 716 except StopIteration: |
717 return None | 717 return None |
718 | 718 |
719 return property_deleter(deleter) | 719 return property_deleter(deleter) |
OLD | NEW |