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

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

Issue 1202683002: bindings: Supports per-member [Exposed] for attributes on prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 not (attribute['is_static'] or 291 not (attribute['is_static'] or
292 attribute['runtime_enabled_function']) and 292 attribute['runtime_enabled_function']) and
293 attribute['should_be_exposed_to_script'] 293 attribute['should_be_exposed_to_script']
294 for attribute in attributes), 294 for attribute in attributes),
295 'has_attribute_configuration': any( 295 'has_attribute_configuration': any(
296 not (attribute['is_expose_js_accessors'] or 296 not (attribute['is_expose_js_accessors'] or
297 attribute['is_static'] or 297 attribute['is_static'] or
298 attribute['runtime_enabled_function']) 298 attribute['runtime_enabled_function'])
299 and attribute['should_be_exposed_to_script'] 299 and attribute['should_be_exposed_to_script']
300 for attribute in attributes), 300 for attribute in attributes),
301 'has_conditional_attributes': has_conditional_attributes,
302 'has_constructor_attributes': any(attribute['constructor_type'] for attr ibute in attributes), 301 'has_constructor_attributes': any(attribute['constructor_type'] for attr ibute in attributes),
303 'has_replaceable_attributes': any(attribute['is_replaceable'] for attrib ute in attributes), 302 'has_replaceable_attributes': any(attribute['is_replaceable'] for attrib ute in attributes),
304 }) 303 })
305 304
306 # Methods 305 # Methods
307 methods = [] 306 methods = []
308 if interface.original_interface: 307 if interface.original_interface:
309 methods.extend([v8_methods.method_context(interface, operation, is_visib le=False) 308 methods.extend([v8_methods.method_context(interface, operation, is_visib le=False)
310 for operation in interface.original_interface.operations 309 for operation in interface.original_interface.operations
311 if operation.name]) 310 if operation.name])
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 'has_origin_safe_method_setter': any( 552 'has_origin_safe_method_setter': any(
554 method['is_check_security_for_frame'] and not method['is_read_only'] 553 method['is_check_security_for_frame'] and not method['is_read_only']
555 for method in methods), 554 for method in methods),
556 'has_private_script': any(attribute['is_implemented_in_private_script'] for attribute in attributes) or 555 'has_private_script': any(attribute['is_implemented_in_private_script'] for attribute in attributes) or
557 any(method['is_implemented_in_private_script'] for method in methods ), 556 any(method['is_implemented_in_private_script'] for method in methods ),
558 'iterator_method': iterator_method, 557 'iterator_method': iterator_method,
559 'method_configuration_methods': method_configuration_methods, 558 'method_configuration_methods': method_configuration_methods,
560 'methods': methods, 559 'methods': methods,
561 }) 560 })
562 561
562 # Conditionally enabled members
563 has_conditional_attributes_on_instance = any(
564 attribute['exposed_test'] and attribute['on_instance']
565 for attribute in attributes)
566 has_conditional_attributes_on_prototype = any(
567 attribute['exposed_test'] and attribute['on_prototype']
568 for attribute in attributes)
569 context.update({
570 'has_conditional_attributes_on_instance':
571 has_conditional_attributes_on_instance,
572 'has_conditional_attributes_on_prototype':
573 has_conditional_attributes_on_prototype,
574 'has_conditional_member_on_prototype': (
575 unscopeables or
bashi 2015/06/23 08:21:03 It seems that |unscopeables| do nothing with condi
Yuki 2015/06/23 08:36:05 Good catch! Done.
576 conditionally_enabled_methods or
577 has_conditional_attributes_on_prototype),
578 })
579
563 context.update({ 580 context.update({
564 'indexed_property_getter': property_getter(interface.indexed_property_ge tter, ['index']), 581 'indexed_property_getter': property_getter(interface.indexed_property_ge tter, ['index']),
565 'indexed_property_setter': property_setter(interface.indexed_property_se tter, interface), 582 'indexed_property_setter': property_setter(interface.indexed_property_se tter, interface),
566 'indexed_property_deleter': property_deleter(interface.indexed_property_ deleter), 583 'indexed_property_deleter': property_deleter(interface.indexed_property_ deleter),
567 'is_override_builtins': 'OverrideBuiltins' in extended_attributes, 584 'is_override_builtins': 'OverrideBuiltins' in extended_attributes,
568 'named_property_getter': property_getter(interface.named_property_getter , ['propertyName']), 585 'named_property_getter': property_getter(interface.named_property_getter , ['propertyName']),
569 'named_property_setter': property_setter(interface.named_property_setter , interface), 586 'named_property_setter': property_setter(interface.named_property_setter , interface),
570 'named_property_deleter': property_deleter(interface.named_property_dele ter), 587 'named_property_deleter': property_deleter(interface.named_property_dele ter),
571 }) 588 })
572 589
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 1359
1343 extended_attributes = deleter.extended_attributes 1360 extended_attributes = deleter.extended_attributes
1344 idl_type = deleter.idl_type 1361 idl_type = deleter.idl_type
1345 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1362 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1346 return { 1363 return {
1347 'is_call_with_script_state': is_call_with_script_state, 1364 'is_call_with_script_state': is_call_with_script_state,
1348 'is_custom': 'Custom' in extended_attributes, 1365 'is_custom': 'Custom' in extended_attributes,
1349 'is_raises_exception': 'RaisesException' in extended_attributes, 1366 'is_raises_exception': 'RaisesException' in extended_attributes,
1350 'name': cpp_name(deleter), 1367 'name': cpp_name(deleter),
1351 } 1368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698