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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Rebase; Respect runtime-enabled flags as well Created 4 years, 7 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 d51373033fb3f80335fea6612e12f9f645b8fbb3..f059f162c78338314c3406a323fd1bdad8a35e1e 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -142,6 +142,7 @@ def attribute_context(interface, attribute):
'on_interface': v8_utilities.on_interface(interface, attribute),
'on_prototype': v8_utilities.on_prototype(interface, attribute),
'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(attribute), # [OriginTrialEnabled]
+ 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(attribute), # [OriginTrialEnabled]
'use_output_parameter_for_result': idl_type.use_output_parameter_for_result,
'measure_as': v8_utilities.measure_as(attribute, interface), # [MeasureAs]
'name': attribute.name,
@@ -169,12 +170,20 @@ def attribute_context(interface, attribute):
if not has_custom_setter(attribute) and has_setter(interface, attribute):
setter_context(interface, attribute, context)
+ # [OriginTrialEnabled]
+ # TODO(iclelland): Allow origin trials on static interfaces
+ # (crbug.com/614352)
+ if context['origin_trial_feature_name'] and context['on_interface']:
+ raise Exception('[OriginTrialEnabled] cannot be specified on static '
+ 'attributes: %s.%s' % (interface.name, attribute.name))
+
return context
def filter_has_accessor_configuration(attributes):
return [attribute for attribute in attributes if
not (attribute['exposed_test'] or
+ attribute['origin_trial_enabled_function'] or
attribute['runtime_enabled_function']) and
not attribute['is_data_type_property'] and
attribute['should_be_exposed_to_script']]
@@ -183,11 +192,18 @@ def filter_has_accessor_configuration(attributes):
def filter_has_attribute_configuration(attributes):
return [attribute for attribute in attributes if
not (attribute['exposed_test'] or
+ attribute['origin_trial_enabled_function'] or
attribute['runtime_enabled_function']) and
attribute['is_data_type_property'] and
attribute['should_be_exposed_to_script']]
+def filter_origin_trial_enabled(attributes):
+ return [attribute for attribute in attributes if
+ attribute['origin_trial_feature_name'] and
+ not attribute['exposed_test']]
+
+
def filter_runtime_enabled(attributes):
return [attribute for attribute in attributes if
attribute['runtime_feature_name'] and
@@ -197,6 +213,7 @@ def filter_runtime_enabled(attributes):
def attribute_filters():
return {'has_accessor_configuration': filter_has_accessor_configuration,
'has_attribute_configuration': filter_has_attribute_configuration,
+ 'origin_trial_enabled_attributes': filter_origin_trial_enabled,
'runtime_enabled_attributes': filter_runtime_enabled,
}

Powered by Google App Engine
This is Rietveld 408576698