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

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

Issue 2439013002: Implement cross-origin attributes using access check interceptors. (Closed)
Patch Set: Attributes, sort of Created 4 years, 2 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 2f0f27665031708fd2a7c25ff3a05e9fc7bd0a57..5873b2ac0d7a05b4951f01d4a14e9822856a0701 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -68,10 +68,11 @@ def attribute_context(interface, attribute, interfaces):
includes.add('core/inspector/ConsoleMessage.h')
# [CheckSecurity]
- is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes
+ is_cross_origin = 'CrossOrigin' in extended_attributes
+ # TODO(dcheng): Does this actually need to take CrossOrigin into account?
is_check_security_for_receiver = (
has_extended_attribute_value(interface, 'CheckSecurity', 'Receiver') and
- not is_do_not_check_security)
+ not is_cross_origin)
is_check_security_for_return_value = (
has_extended_attribute_value(attribute, 'CheckSecurity', 'ReturnValue'))
if is_check_security_for_receiver or is_check_security_for_return_value:
@@ -142,6 +143,7 @@ def attribute_context(interface, attribute, interfaces):
'is_ce_reactions': is_ce_reactions,
'is_check_security_for_receiver': is_check_security_for_receiver,
'is_check_security_for_return_value': is_check_security_for_return_value,
+ 'is_cross_origin': 'CrossOrigin' in extended_attributes,
'is_custom_element_callbacks': is_custom_element_callbacks,
# TODO(yukishiino): Make all DOM attributes accessor-type properties.
'is_data_type_property': is_data_type_property(interface, attribute),
@@ -527,18 +529,10 @@ def has_setter(interface, attribute):
return is_writable(attribute)
-# [DoNotCheckSecurity], [Unforgeable]
+# [Unforgeable]
def access_control_list(interface, attribute):
extended_attributes = attribute.extended_attributes
access_control = []
- if 'DoNotCheckSecurity' in extended_attributes:
- do_not_check_security = extended_attributes['DoNotCheckSecurity']
- if do_not_check_security == 'Setter':
- access_control.append('v8::ALL_CAN_WRITE')
- else:
- access_control.append('v8::ALL_CAN_READ')
- if has_setter(interface, attribute):
- access_control.append('v8::ALL_CAN_WRITE')
if is_unforgeable(interface, attribute):
access_control.append('v8::PROHIBITS_OVERWRITING')
return access_control or ['v8::DEFAULT']

Powered by Google App Engine
This is Rietveld 408576698