| 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..d2434b08ef516e9220c7839324be6e7f948520db 100644
|
| --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| @@ -48,7 +48,8 @@ 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,
|
| has_extended_attribute_value, runtime_enabled_function_name,
|
| - extended_attribute_value_as_list, is_legacy_interface_type_checking)
|
| + extended_attribute_value_as_list, is_legacy_interface_type_checking,
|
| + api_experiment_name)
|
|
|
|
|
| INTERFACE_H_INCLUDES = frozenset([
|
| @@ -65,6 +66,7 @@ INTERFACE_CPP_INCLUDES = frozenset([
|
| 'bindings/core/v8/V8ObjectConstructor.h',
|
| 'core/dom/ContextFeatures.h',
|
| 'core/dom/Document.h',
|
| + 'core/experiments/Experiments.h',
|
| 'platform/RuntimeEnabledFeatures.h',
|
| 'platform/TraceEvent.h',
|
| 'wtf/GetPtr.h',
|
| @@ -163,6 +165,7 @@ def interface_context(interface):
|
| v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface)
|
|
|
| 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,
|
| @@ -239,10 +242,10 @@ def interface_context(interface):
|
| unscopeables = []
|
| for attribute in interface.attributes:
|
| if 'Unscopeable' in attribute.extended_attributes:
|
| - unscopeables.append((attribute.name, v8_utilities.runtime_enabled_function_name(attribute)))
|
| + unscopeables.append((attribute.name, v8_utilities.runtime_enabled_function_name(attribute), v8_utilities.api_experiment_name(attribute)))
|
| for method in interface.operations:
|
| if 'Unscopeable' in method.extended_attributes:
|
| - unscopeables.append((method.name, v8_utilities.runtime_enabled_function_name(method)))
|
| + unscopeables.append((method.name, v8_utilities.runtime_enabled_function_name(method), v8_utilities.api_experiment_name(method)))
|
|
|
| context.update({
|
| 'constructors': constructors,
|
| @@ -258,9 +261,12 @@ def interface_context(interface):
|
|
|
| special_getter_constants = []
|
| runtime_enabled_constants = dict()
|
| + experimental_enabled_constants = dict()
|
| + experimental_only_enabled_constants = []
|
| constant_configuration_constants = []
|
|
|
| for constant in constants:
|
| + api_experiment_name = constant['api_experiment_name']
|
| if constant['measure_as'] or constant['deprecate_as']:
|
| special_getter_constants.append(constant)
|
| continue
|
| @@ -269,6 +275,11 @@ def interface_context(interface):
|
| if runtime_enabled_function not in runtime_enabled_constants:
|
| runtime_enabled_constants[runtime_enabled_function] = []
|
| runtime_enabled_constants[runtime_enabled_function].append(constant)
|
| + if api_experiment_name:
|
| + experimental_enabled_constants[constant['name']] = api_experiment_name
|
| + continue
|
| + if api_experiment_name:
|
| + experimental_only_enabled_constants.append(constant)
|
| continue
|
| constant_configuration_constants.append(constant)
|
|
|
| @@ -277,8 +288,10 @@ def interface_context(interface):
|
| 'constant_configuration_constants': constant_configuration_constants,
|
| 'constants': constants,
|
| 'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes,
|
| + 'experimental_enabled_constants': experimental_enabled_constants,
|
| + 'experimental_only_constants': experimental_only_enabled_constants,
|
| 'has_constant_configuration': any(
|
| - not constant['runtime_enabled_function']
|
| + (constant['runtime_enabled_function'] is None and constant['api_experiment_name'] is None)
|
| for constant in constants),
|
| 'runtime_enabled_constants': sorted(runtime_enabled_constants.iteritems()),
|
| 'special_getter_constants': special_getter_constants,
|
| @@ -523,6 +536,7 @@ def interface_context(interface):
|
| continue
|
| conditionally_exposed_function = overloads['exposed_test_all']
|
| runtime_enabled_function = overloads['runtime_enabled_function_all']
|
| + api_experiment_name = overloads['api_experiment_name_all']
|
| has_custom_registration = (overloads['has_custom_registration_all'] or
|
| overloads['runtime_determined_lengths'])
|
| else:
|
| @@ -530,6 +544,7 @@ def interface_context(interface):
|
| continue
|
| conditionally_exposed_function = method['exposed_test']
|
| runtime_enabled_function = method['runtime_enabled_function']
|
| + api_experiment_name = method['api_experiment_name']
|
| has_custom_registration = method['has_custom_registration']
|
|
|
| if has_custom_registration:
|
| @@ -541,6 +556,9 @@ def interface_context(interface):
|
| if runtime_enabled_function:
|
| custom_registration_methods.append(method)
|
| continue
|
| + if api_experiment_name:
|
| + custom_registration_methods.append(method)
|
| + continue
|
| if method['should_be_exposed_to_script']:
|
| method_configuration_methods.append(method)
|
|
|
| @@ -615,6 +633,7 @@ def constant_context(constant, interface):
|
| # FIXME: use 'reflected_name' as correct 'name'
|
| 'reflected_name': extended_attributes.get('Reflect', constant.name),
|
| 'runtime_enabled_function': runtime_enabled_function_name(constant),
|
| + 'api_experiment_name': extended_attributes.get('APIExperimentEnabled'),
|
| 'value': constant.value,
|
| }
|
|
|
| @@ -769,6 +788,7 @@ def overloads_context(interface, overloads):
|
| 'deprecate_all_as': common_value(overloads, 'deprecate_as'), # [DeprecateAs]
|
| 'exposed_test_all': common_value(overloads, 'exposed_test'), # [Exposed]
|
| 'has_custom_registration_all': common_value(overloads, 'has_custom_registration'),
|
| + 'api_experiment_name_all': common_value(overloads, 'api_experiment_name'), # [APIExperimentEnabled]
|
| 'length': function_length,
|
| 'length_tests_methods': length_tests_methods(effective_overloads_by_length),
|
| # 1. Let maxarg be the length of the longest type list of the
|
|
|