Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: Source/bindings/scripts/unstable/v8_interface.py

Issue 139653005: IDL compiler: sync Python to r166626 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactored Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/templates/interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if is_document: 81 if is_document:
82 includes.update(['bindings/v8/ScriptController.h', 82 includes.update(['bindings/v8/ScriptController.h',
83 'bindings/v8/V8WindowShell.h', 83 'bindings/v8/V8WindowShell.h',
84 'core/frame/Frame.h']) 84 'core/frame/Frame.h'])
85 85
86 # [CheckSecurity] 86 # [CheckSecurity]
87 is_check_security = 'CheckSecurity' in extended_attributes 87 is_check_security = 'CheckSecurity' in extended_attributes
88 if is_check_security: 88 if is_check_security:
89 includes.add('bindings/v8/BindingSecurity.h') 89 includes.add('bindings/v8/BindingSecurity.h')
90 90
91 # [GarbageCollected]
92 is_garbage_collected = 'GarbageCollected' in extended_attributes
93
94 # [MeasureAs]
95 is_measure_as = 'MeasureAs' in extended_attributes
96 if is_measure_as:
97 includes.add('core/frame/UseCounter.h')
98
91 # [SetWrapperReferenceFrom] 99 # [SetWrapperReferenceFrom]
92 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom') 100 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
93 if reachable_node_function: 101 if reachable_node_function:
94 includes.update(['bindings/v8/V8GCController.h', 102 includes.update(['bindings/v8/V8GCController.h',
95 'core/dom/Element.h']) 103 'core/dom/Element.h'])
96 104
97 # [MeasureAs]
98 is_measure_as = 'MeasureAs' in extended_attributes
99 if is_measure_as:
100 includes.add('core/frame/UseCounter.h')
101
102 # [SetWrapperReferenceTo] 105 # [SetWrapperReferenceTo]
103 set_wrapper_reference_to_list = [{ 106 set_wrapper_reference_to_list = [{
104 'name': argument.name, 107 'name': argument.name,
105 'idl_type': argument.idl_type, 108 'idl_type': argument.idl_type,
106 'v8_type': v8_types.v8_type(argument.idl_type), 109 'v8_type': v8_types.v8_type(argument.idl_type),
107 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] 110 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])]
108 for set_wrapper_reference_to in set_wrapper_reference_to_list: 111 for set_wrapper_reference_to in set_wrapper_reference_to_list:
109 v8_types.add_includes_for_type(set_wrapper_reference_to['idl_type']) 112 v8_types.add_includes_for_type(set_wrapper_reference_to['idl_type'])
110 113
111 # [SpecialWrapFor] 114 # [SpecialWrapFor]
(...skipping 16 matching lines...) Expand all
128 reachable_node_function or set_wrapper_reference_to_list), 131 reachable_node_function or set_wrapper_reference_to_list),
129 'header_includes': header_includes, 132 'header_includes': header_includes,
130 'interface_name': interface.name, 133 'interface_name': interface.name,
131 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject] 134 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject]
132 'is_audio_buffer': is_audio_buffer, 135 'is_audio_buffer': is_audio_buffer,
133 'is_check_security': is_check_security, 136 'is_check_security': is_check_security,
134 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime] 137 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime]
135 'is_document': is_document, 138 'is_document': is_document,
136 'is_event_target': inherits_interface(interface.name, 'EventTarget'), 139 'is_event_target': inherits_interface(interface.name, 'EventTarget'),
137 'is_exception': interface.is_exception, 140 'is_exception': interface.is_exception,
138 'is_garbage_collected': 'GarbageCollected' in extended_attributes, # [G arbageCollected] 141 'is_garbage_collected': is_garbage_collected,
139 'is_node': inherits_interface(interface.name, 'Node'), 142 'is_node': inherits_interface(interface.name, 'Node'),
140 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] 143 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
141 'parent_interface': parent_interface, 144 'parent_interface': parent_interface,
145 'pass_ref_ptr': 'PassRefPtrWillBeRawPtr' if is_garbage_collected else
146 'PassRefPtr',
142 'reachable_node_function': reachable_node_function, 147 'reachable_node_function': reachable_node_function,
148 'ref_ptr': 'RefPtrWillBeRawPtr' if is_garbage_collected else 'RefPtr',
143 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled] 149 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled]
144 'set_wrapper_reference_to_list': set_wrapper_reference_to_list, 150 'set_wrapper_reference_to_list': set_wrapper_reference_to_list,
145 'special_wrap_for': special_wrap_for, 151 'special_wrap_for': special_wrap_for,
146 'v8_class': v8_utilities.v8_class_name(interface), 152 'v8_class': v8_utilities.v8_class_name(interface),
147 } 153 }
148 154
149 # Constructors 155 # Constructors
150 constructors = [generate_constructor(interface, constructor) 156 constructors = [generate_constructor(interface, constructor)
151 for constructor in interface.constructors 157 for constructor in interface.constructors
152 # FIXME: shouldn't put named constructors with constructors 158 # FIXME: shouldn't put named constructors with constructors
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 deleter = next( 697 deleter = next(
692 method 698 method
693 for method in interface.operations 699 for method in interface.operations
694 if ('deleter' in method.specials and 700 if ('deleter' in method.specials and
695 len(method.arguments) == 1 and 701 len(method.arguments) == 1 and
696 method.arguments[0].idl_type == 'DOMString')) 702 method.arguments[0].idl_type == 'DOMString'))
697 except StopIteration: 703 except StopIteration:
698 return None 704 return None
699 705
700 return property_deleter(deleter) 706 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698