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

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

Issue 877523004: Add extended attribute, [Measure], to simplify use counting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove inheritance of [Measure] Created 5 years, 9 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 | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_methods.py » ('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 # 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 'is_event_target': is_event_target, 186 'is_event_target': is_event_target,
187 'is_exception': interface.is_exception, 187 'is_exception': interface.is_exception,
188 'is_node': inherits_interface(interface.name, 'Node'), 188 'is_node': inherits_interface(interface.name, 'Node'),
189 'is_partial': interface.is_partial, 189 'is_partial': interface.is_partial,
190 'is_typed_array_type': is_typed_array_type, 190 'is_typed_array_type': is_typed_array_type,
191 'lifetime': 'Dependent' 191 'lifetime': 'Dependent'
192 if (has_visit_dom_wrapper or 192 if (has_visit_dom_wrapper or
193 is_active_dom_object or 193 is_active_dom_object or
194 is_dependent_lifetime) 194 is_dependent_lifetime)
195 else 'Independent', 195 else 'Independent',
196 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] 196 'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs]
197 'parent_interface': parent_interface, 197 'parent_interface': parent_interface,
198 'pass_cpp_type': cpp_template_type( 198 'pass_cpp_type': cpp_template_type(
199 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type), 199 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type),
200 cpp_name(interface)), 200 cpp_name(interface)),
201 'reachable_node_function': reachable_node_function, 201 'reachable_node_function': reachable_node_function,
202 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled] 202 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled]
203 'set_wrapper_reference_to_list': set_wrapper_reference_to_list, 203 'set_wrapper_reference_to_list': set_wrapper_reference_to_list,
204 'v8_class': v8_class_name, 204 'v8_class': v8_class_name,
205 'v8_class_or_partial': v8_class_name_or_partial, 205 'v8_class_or_partial': v8_class_name_or_partial,
206 'wrapper_class_id': wrapper_class_id, 206 'wrapper_class_id': wrapper_class_id,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 'any_type_attributes': any_type_attributes, 248 'any_type_attributes': any_type_attributes,
249 'constructors': constructors, 249 'constructors': constructors,
250 'has_custom_constructor': bool(custom_constructors), 250 'has_custom_constructor': bool(custom_constructors),
251 'has_event_constructor': has_event_constructor, 251 'has_event_constructor': has_event_constructor,
252 'interface_length': 252 'interface_length':
253 interface_length(interface, constructors + custom_constructors), 253 interface_length(interface, constructors + custom_constructors),
254 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor] 254 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor]
255 'named_constructor': named_constructor, 255 'named_constructor': named_constructor,
256 }) 256 })
257 257
258 constants = [constant_context(constant) for constant in interface.constants] 258 constants = [constant_context(constant, interface) for constant in interface .constants]
259 259
260 special_getter_constants = [] 260 special_getter_constants = []
261 runtime_enabled_constants = [] 261 runtime_enabled_constants = []
262 constant_configuration_constants = [] 262 constant_configuration_constants = []
263 263
264 for constant in constants: 264 for constant in constants:
265 if constant['measure_as'] or constant['deprecate_as']: 265 if constant['measure_as'] or constant['deprecate_as']:
266 special_getter_constants.append(constant) 266 special_getter_constants.append(constant)
267 continue 267 continue
268 if constant['runtime_enabled_function']: 268 if constant['runtime_enabled_function']:
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 'is_override_builtins': 'OverrideBuiltins' in extended_attributes, 557 'is_override_builtins': 'OverrideBuiltins' in extended_attributes,
558 'named_property_getter': property_getter(interface.named_property_getter , ['propertyName']), 558 'named_property_getter': property_getter(interface.named_property_getter , ['propertyName']),
559 'named_property_setter': property_setter(interface.named_property_setter , interface), 559 'named_property_setter': property_setter(interface.named_property_setter , interface),
560 'named_property_deleter': property_deleter(interface.named_property_dele ter), 560 'named_property_deleter': property_deleter(interface.named_property_dele ter),
561 }) 561 })
562 562
563 return context 563 return context
564 564
565 565
566 # [DeprecateAs], [Reflect], [RuntimeEnabled] 566 # [DeprecateAs], [Reflect], [RuntimeEnabled]
567 def constant_context(constant): 567 def constant_context(constant, interface):
568 extended_attributes = constant.extended_attributes 568 extended_attributes = constant.extended_attributes
569 return { 569 return {
570 'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'), 570 'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'),
571 'deprecate_as': v8_utilities.deprecate_as(constant), # [DeprecateAs] 571 'deprecate_as': v8_utilities.deprecate_as(constant), # [DeprecateAs]
572 'idl_type': constant.idl_type.name, 572 'idl_type': constant.idl_type.name,
573 'measure_as': v8_utilities.measure_as(constant), # [MeasureAs] 573 'measure_as': v8_utilities.measure_as(constant, interface), # [MeasureA s]
574 'name': constant.name, 574 'name': constant.name,
575 # FIXME: use 'reflected_name' as correct 'name' 575 # FIXME: use 'reflected_name' as correct 'name'
576 'reflected_name': extended_attributes.get('Reflect', constant.name), 576 'reflected_name': extended_attributes.get('Reflect', constant.name),
577 'runtime_enabled_function': runtime_enabled_function_name(constant), 577 'runtime_enabled_function': runtime_enabled_function_name(constant),
578 'value': constant.value, 578 'value': constant.value,
579 } 579 }
580 580
581 581
582 ################################################################################ 582 ################################################################################
583 # Overloads 583 # Overloads
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 if not deleter: 1296 if not deleter:
1297 return None 1297 return None
1298 1298
1299 idl_type = deleter.idl_type 1299 idl_type = deleter.idl_type
1300 extended_attributes = deleter.extended_attributes 1300 extended_attributes = deleter.extended_attributes
1301 return { 1301 return {
1302 'is_custom': 'Custom' in extended_attributes, 1302 'is_custom': 'Custom' in extended_attributes,
1303 'is_raises_exception': 'RaisesException' in extended_attributes, 1303 'is_raises_exception': 'RaisesException' in extended_attributes,
1304 'name': cpp_name(deleter), 1304 'name': cpp_name(deleter),
1305 } 1305 }
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698