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

Unified 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: Addressing comments. Created 4 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/scripts/v8_attributes.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
index 96b8964d46a8f781f270a528c79b2ac3a8f90be0..277bbbc18bf2793c02e6d23e64f0aad5a1fbdfba 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -98,11 +98,18 @@ def attribute_context(interface, attribute):
if cached_attribute_validation_method or keep_alive_for_gc:
includes.add('bindings/core/v8/V8HiddenValue.h')
+ if 'APIExperimentEnabled' in extended_attributes:
+ includes.add('core/experiments/ExperimentalFeatures.h')
+ includes.add('core/inspector/ConsoleMessage.h')
+
context = {
'access_control_list': access_control_list(interface, attribute),
'activity_logging_world_list_for_getter': v8_utilities.activity_logging_world_list(attribute, 'Getter'), # [ActivityLogging]
'activity_logging_world_list_for_setter': v8_utilities.activity_logging_world_list(attribute, 'Setter'), # [ActivityLogging]
'activity_logging_world_check': v8_utilities.activity_logging_world_check(attribute), # [ActivityLogging]
+ 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(attribute), # [APIExperimentEnabled]
+ 'api_experiment_enabled_per_interface': v8_utilities.api_experiment_enabled_function(interface), # [APIExperimentEnabled]
+ 'api_experiment_name': extended_attributes.get('APIExperimentEnabled'), # [APIExperimentEnabled]
'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
'cached_attribute_validation_method': cached_attribute_validation_method,
'conditional_string': conditional_string,
@@ -118,6 +125,7 @@ def attribute_context(interface, attribute):
'has_custom_setter': has_custom_setter(attribute),
'has_setter': has_setter(attribute),
'idl_type': str(idl_type), # need trailing [] on array for Dictionary::ConversionContext::setConversionType
+ 'is_api_experiment_enabled': v8_utilities.api_experiment_enabled_function(attribute) or v8_utilities.api_experiment_enabled_function(interface), # [APIExperimentEnabled]
'is_call_with_execution_context': has_extended_attribute_value(attribute, 'CallWith', 'ExecutionContext'),
'is_call_with_script_state': has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'),
'is_check_security_for_receiver': is_check_security_for_receiver,
@@ -509,7 +517,7 @@ def is_constructor_attribute(attribute):
def update_constructor_attribute_context(interface, attribute, context):
- context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as']
+ context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as'] or context['api_experiment_name']
# When the attribute name is the same as the interface name, do not generate
# callback functions for each attribute and use
# {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate

Powered by Google App Engine
This is Rietveld 408576698