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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.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_interface.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
index 95bebe6d73e6bad0083dace58c3c811477425eee..5e22ef0dfb19034ef4d06992fc24d0e68d98e5f5 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
@@ -46,7 +46,7 @@ import v8_methods
import v8_types
from v8_types import cpp_ptr_type, cpp_template_type
import v8_utilities
-from v8_utilities import (cpp_name_or_partial, capitalize, conditional_string, cpp_name, gc_type,
+from v8_utilities import (api_experiment_enabled_function, cpp_name_or_partial, capitalize, conditional_string, cpp_name, gc_type,
has_extended_attribute_value, runtime_enabled_function_name,
extended_attribute_value_as_list, is_legacy_interface_type_checking)
@@ -162,7 +162,12 @@ def interface_context(interface):
cpp_class_name_or_partial = cpp_name_or_partial(interface)
v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface)
+ if 'APIExperimentEnabled' in extended_attributes:
+ includes.add('core/experiments/ExperimentalFeatures.h')
+ includes.add('core/inspector/ConsoleMessage.h')
+
context = {
+ 'api_experiment_name': v8_utilities.api_experiment_name(interface),
'conditional_string': conditional_string(interface), # [Conditional]
'cpp_class': cpp_class_name,
'cpp_class_or_partial': cpp_class_name_or_partial,
@@ -261,7 +266,7 @@ def interface_context(interface):
constant_configuration_constants = []
for constant in constants:
- if constant['measure_as'] or constant['deprecate_as']:
+ if constant['measure_as'] or constant['deprecate_as'] or constant['api_experiment_name']:
special_getter_constants.append(constant)
continue
runtime_enabled_function = constant['runtime_enabled_function']
@@ -606,10 +611,19 @@ def interface_context(interface):
# [DeprecateAs], [Reflect], [RuntimeEnabled]
def constant_context(constant, interface):
extended_attributes = constant.extended_attributes
+
+ if 'APIExperimentEnabled' in extended_attributes:
+ includes.add('core/experiments/ExperimentalFeatures.h')
+ includes.add('core/inspector/ConsoleMessage.h')
+
return {
+ 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(constant), # [APIExperimentEnabled]
+ 'api_experiment_enabled_per_interface': v8_utilities.api_experiment_enabled_function(interface), # [APIExperimentEnabled]
+ 'api_experiment_name': extended_attributes.get('APIExperimentEnabled'), # [APIExperimentEnabled]
'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'),
'deprecate_as': v8_utilities.deprecate_as(constant), # [DeprecateAs]
'idl_type': constant.idl_type.name,
+ 'is_api_experiment_enabled': v8_utilities.api_experiment_enabled_function(constant) or v8_utilities.api_experiment_enabled_function(interface), # [APIExperimentEnabled]
'measure_as': v8_utilities.measure_as(constant, interface), # [MeasureAs]
'name': constant.name,
# FIXME: use 'reflected_name' as correct 'name'
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_attributes.py ('k') | third_party/WebKit/Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698