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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Install interfaces/attributes/methods unconditionally. Use the generated ExperimentalFeature functi… Created 4 years, 11 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
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 cached_attribute_validation_method = extended_attributes.get('CachedAttribut e') 96 cached_attribute_validation_method = extended_attributes.get('CachedAttribut e')
97 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) 97 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute)
98 if cached_attribute_validation_method or keep_alive_for_gc: 98 if cached_attribute_validation_method or keep_alive_for_gc:
99 includes.add('bindings/core/v8/V8HiddenValue.h') 99 includes.add('bindings/core/v8/V8HiddenValue.h')
100 100
101 context = { 101 context = {
102 'access_control_list': access_control_list(interface, attribute), 102 'access_control_list': access_control_list(interface, attribute),
103 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_ world_list(attribute, 'Getter'), # [ActivityLogging] 103 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_ world_list(attribute, 'Getter'), # [ActivityLogging]
104 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_ world_list(attribute, 'Setter'), # [ActivityLogging] 104 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_ world_list(attribute, 'Setter'), # [ActivityLogging]
105 'activity_logging_world_check': v8_utilities.activity_logging_world_chec k(attribute), # [ActivityLogging] 105 'activity_logging_world_check': v8_utilities.activity_logging_world_chec k(attribute), # [ActivityLogging]
106 'api_experiment_name': extended_attributes.get('APIExperimentEnabled'), # [APIExperimentEnabled]
107 'api_experiment_inherited_enabled': v8_utilities.api_experiment_enabled_ function(interface), # [APIExperimentEnabled]
108 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(a ttribute), # [APIExperimentEnabled]
haraken 2015/12/30 00:25:32 Alphabetical order.
Daniel Nishi 2015/12/30 22:05:50 Done.
106 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), 109 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
107 'cached_attribute_validation_method': cached_attribute_validation_method , 110 'cached_attribute_validation_method': cached_attribute_validation_method ,
108 'conditional_string': conditional_string, 111 'conditional_string': conditional_string,
109 'constructor_type': constructor_type, 112 'constructor_type': constructor_type,
110 'cpp_name': cpp_name(attribute), 113 'cpp_name': cpp_name(attribute),
111 'cpp_type': idl_type.cpp_type, 114 'cpp_type': idl_type.cpp_type,
112 'cpp_type_initializer': idl_type.cpp_type_initializer, 115 'cpp_type_initializer': idl_type.cpp_type_initializer,
113 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] 116 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
114 'enum_type': idl_type.enum_type, 117 'enum_type': idl_type.enum_type,
115 'enum_values': idl_type.enum_values, 118 'enum_values': idl_type.enum_values,
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 # FIXME: replace this with a [ConstructorAttribute] extended attribute 505 # FIXME: replace this with a [ConstructorAttribute] extended attribute
503 lambda self: strip_suffix(self.base_type, 'Constructor')) 506 lambda self: strip_suffix(self.base_type, 'Constructor'))
504 507
505 508
506 def is_constructor_attribute(attribute): 509 def is_constructor_attribute(attribute):
507 # FIXME: replace this with [ConstructorAttribute] extended attribute 510 # FIXME: replace this with [ConstructorAttribute] extended attribute
508 return attribute.idl_type.name.endswith('Constructor') 511 return attribute.idl_type.name.endswith('Constructor')
509 512
510 513
511 def update_constructor_attribute_context(interface, attribute, context): 514 def update_constructor_attribute_context(interface, attribute, context):
512 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 515 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] or context['api_experiment_name']
513 # When the attribute name is the same as the interface name, do not generate 516 # When the attribute name is the same as the interface name, do not generate
514 # callback functions for each attribute and use 517 # callback functions for each attribute and use
515 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate 518 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
516 # a callback function in order to hard-code the attribute name. 519 # a callback function in order to hard-code the attribute name.
517 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] 520 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698