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

Unified Diff: Source/bindings/scripts/v8_interface.py

Issue 424163002: Enable the WebIDL [Exposed] annotation on an interface's members. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: second iteration Created 6 years, 5 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: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 21c2747c151ce50920308bb99cf2cf54539d53ab..4b99a39f40c547482612e926307a2ddb98b933ec 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -240,8 +240,8 @@ def interface_context(interface):
attribute['per_context_enabled_function'])
and attribute['should_be_exposed_to_script']
for attribute in attributes),
+ 'has_conditional_attributes': any(attribute['per_context_enabled_function'] or attribute['custom_exposed_rules'] for attribute in attributes),
'has_constructor_attributes': any(attribute['constructor_type'] for attribute in attributes),
- 'has_per_context_enabled_attributes': any(attribute['per_context_enabled_function'] for attribute in attributes),
'has_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
})
@@ -265,6 +265,7 @@ def interface_context(interface):
methods.append(v8_methods.method_context(interface, method))
per_context_enabled_methods = []
+ conditionally_exposed_methods = []
custom_registration_methods = []
method_configuration_methods = []
@@ -276,16 +277,21 @@ def interface_context(interface):
if 'overloads' in method:
overloads = method['overloads']
per_context_enabled_function = overloads['per_context_enabled_function_all']
+ conditionally_exposed_function = overloads['custom_exposed_rules_all']
runtime_enabled_function = overloads['runtime_enabled_function_all']
has_custom_registration = overloads['has_custom_registration_all']
else:
per_context_enabled_function = method['per_context_enabled_function']
+ conditionally_exposed_function = method['custom_exposed_rules']
runtime_enabled_function = method['runtime_enabled_function']
has_custom_registration = method['has_custom_registration']
if per_context_enabled_function:
per_context_enabled_methods.append(method)
continue
+ if conditionally_exposed_function:
+ conditionally_exposed_methods.append(method)
+ continue
if runtime_enabled_function or has_custom_registration:
custom_registration_methods.append(method)
continue
@@ -308,13 +314,15 @@ def interface_context(interface):
method['number_of_required_arguments'])
context.update({
+ 'conditionally_exposed_methods': conditionally_exposed_methods,
'custom_registration_methods': custom_registration_methods,
+ 'has_conditional_methods': per_context_enabled_methods or conditionally_exposed_methods,
'has_origin_safe_method_setter': any(
method['is_check_security_for_frame'] and not method['is_read_only']
for method in methods),
'method_configuration_methods': method_configuration_methods,
- 'per_context_enabled_methods': per_context_enabled_methods,
'methods': methods,
+ 'per_context_enabled_methods': per_context_enabled_methods,
})
context.update({
@@ -436,14 +444,15 @@ def overloads_context(overloads):
% (name, extended_attribute))
return {
+ 'custom_exposed_rules_all': common_value(overloads, 'custom_exposed_rules'), # [Exposed]
'deprecate_all_as': common_value(overloads, 'deprecate_as'), # [DeprecateAs]
+ 'has_custom_registration_all': common_value(overloads, 'has_custom_registration'),
'length_tests_methods': length_tests_methods(effective_overloads_by_length),
- 'minarg': lengths[0],
- # 1. Let maxarg be the length of the longest type list of the
+ # 1. Let maxarg be the length of the longest type list of the
# entries in S.
'maxarg': lengths[-1],
'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs]
- 'has_custom_registration_all': common_value(overloads, 'has_custom_registration'),
+ 'minarg': lengths[0],
'per_context_enabled_function_all': common_value(overloads, 'per_context_enabled_function'), # [PerContextEnabled]
'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled_function'), # [RuntimeEnabled]
'valid_arities': lengths

Powered by Google App Engine
This is Rietveld 408576698