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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. | 247 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. |
248 if active_scriptwrappable and not is_dependent_lifetime: | 248 if active_scriptwrappable and not is_dependent_lifetime: |
249 raise Exception('[ActiveScriptWrappable] interface must also specify ' | 249 raise Exception('[ActiveScriptWrappable] interface must also specify ' |
250 '[DependentLifetime]: %s' % interface.name) | 250 '[DependentLifetime]: %s' % interface.name) |
251 | 251 |
252 v8_class_name = v8_utilities.v8_class_name(interface) | 252 v8_class_name = v8_utilities.v8_class_name(interface) |
253 cpp_class_name = cpp_name(interface) | 253 cpp_class_name = cpp_name(interface) |
254 cpp_class_name_or_partial = cpp_name_or_partial(interface) | 254 cpp_class_name_or_partial = cpp_name_or_partial(interface) |
255 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) | 255 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) |
256 | 256 |
| 257 # TODO(peria): Generate the target list from 'Window' and 'HTMLDocument'. |
| 258 needs_runtime_enabled_installer = v8_class_name in [ |
| 259 'V8Window', 'V8HTMLDocument', 'V8Document', 'V8Node', 'V8EventTarget'] |
| 260 |
257 context = { | 261 context = { |
258 'cpp_class': cpp_class_name, | 262 'cpp_class': cpp_class_name, |
259 'cpp_class_or_partial': cpp_class_name_or_partial, | 263 'cpp_class_or_partial': cpp_class_name_or_partial, |
260 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target
else 'NotInheritFromEventTarget', | 264 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target
else 'NotInheritFromEventTarget', |
261 'is_gc_type': True, | 265 'is_gc_type': True, |
262 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 | 266 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 |
263 'has_access_check_callbacks': (is_check_security and | 267 'has_access_check_callbacks': (is_check_security and |
264 interface.name != 'EventTarget'), | 268 interface.name != 'EventTarget'), |
265 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] | 269 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] |
266 'has_partial_interface': len(interface.partial_interfaces) > 0, | 270 'has_partial_interface': len(interface.partial_interfaces) > 0, |
267 'has_visit_dom_wrapper': has_visit_dom_wrapper, | 271 'has_visit_dom_wrapper': has_visit_dom_wrapper, |
268 'has_visit_dom_wrapper_custom': has_visit_dom_wrapper_custom, | 272 'has_visit_dom_wrapper_custom': has_visit_dom_wrapper_custom, |
269 'header_includes': header_includes, | 273 'header_includes': header_includes, |
270 'interface_name': interface.name, | 274 'interface_name': interface.name, |
271 'is_array_buffer_or_view': is_array_buffer_or_view, | 275 'is_array_buffer_or_view': is_array_buffer_or_view, |
272 'is_check_security': is_check_security, | 276 'is_check_security': is_check_security, |
273 'is_event_target': is_event_target, | 277 'is_event_target': is_event_target, |
274 'is_exception': interface.is_exception, | 278 'is_exception': interface.is_exception, |
275 'is_global': is_global, | 279 'is_global': is_global, |
276 'is_immutable_prototype': is_immutable_prototype, | 280 'is_immutable_prototype': is_immutable_prototype, |
277 'is_node': inherits_interface(interface.name, 'Node'), | 281 'is_node': inherits_interface(interface.name, 'Node'), |
278 'is_partial': interface.is_partial, | 282 'is_partial': interface.is_partial, |
279 'is_typed_array_type': is_typed_array_type, | 283 'is_typed_array_type': is_typed_array_type, |
280 'lifetime': 'Dependent' if (has_visit_dom_wrapper or is_dependent_lifeti
me) else 'Independent', | 284 'lifetime': 'Dependent' if (has_visit_dom_wrapper or is_dependent_lifeti
me) else 'Independent', |
281 'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs] | 285 'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs] |
| 286 'needs_runtime_enabled_installer': needs_runtime_enabled_installer, |
282 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(interface), | 287 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(interface), |
283 'parent_interface': parent_interface, | 288 'parent_interface': parent_interface, |
284 'pass_cpp_type': cpp_name(interface) + '*', | 289 'pass_cpp_type': cpp_name(interface) + '*', |
285 'active_scriptwrappable': active_scriptwrappable, | 290 'active_scriptwrappable': active_scriptwrappable, |
286 'runtime_enabled_feature_name': runtime_enabled_feature_name(interface),
# [RuntimeEnabled] | 291 'runtime_enabled_feature_name': runtime_enabled_feature_name(interface),
# [RuntimeEnabled] |
287 'set_wrapper_reference_from': set_wrapper_reference_from, | 292 'set_wrapper_reference_from': set_wrapper_reference_from, |
288 'set_wrapper_reference_to': set_wrapper_reference_to, | 293 'set_wrapper_reference_to': set_wrapper_reference_to, |
289 'v8_class': v8_class_name, | 294 'v8_class': v8_class_name, |
290 'v8_class_or_partial': v8_class_name_or_partial, | 295 'v8_class_or_partial': v8_class_name_or_partial, |
291 'wrapper_class_id': wrapper_class_id, | 296 'wrapper_class_id': wrapper_class_id, |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 extended_attributes = deleter.extended_attributes | 1501 extended_attributes = deleter.extended_attributes |
1497 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') | 1502 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') |
1498 is_ce_reactions = 'CEReactions' in extended_attributes | 1503 is_ce_reactions = 'CEReactions' in extended_attributes |
1499 return { | 1504 return { |
1500 'is_call_with_script_state': is_call_with_script_state, | 1505 'is_call_with_script_state': is_call_with_script_state, |
1501 'is_ce_reactions': is_ce_reactions, | 1506 'is_ce_reactions': is_ce_reactions, |
1502 'is_custom': 'Custom' in extended_attributes, | 1507 'is_custom': 'Custom' in extended_attributes, |
1503 'is_raises_exception': 'RaisesException' in extended_attributes, | 1508 'is_raises_exception': 'RaisesException' in extended_attributes, |
1504 'name': cpp_name(deleter), | 1509 'name': cpp_name(deleter), |
1505 } | 1510 } |
OLD | NEW |