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 301010363d843c2d835df59ab31e5a5340182350..5cb153054d82b54f111446fa83fcbcdf088e76c0 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py |
+++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py |
@@ -370,9 +370,6 @@ def interface_context(interface, interfaces): |
# Methods |
methods, iterator_method = methods_context(interface) |
context.update({ |
- 'has_origin_safe_method_setter': is_global and any( |
- method['is_check_security_for_receiver'] and not method['is_unforgeable'] |
- for method in methods), |
'has_private_script': (any(attribute['is_implemented_in_private_script'] for attribute in attributes) or |
any(method['is_implemented_in_private_script'] for method in methods)), |
'iterator_method': iterator_method, |
@@ -416,6 +413,34 @@ def interface_context(interface, interfaces): |
context.update({ |
'origin_trial_features': origin_trial_features(interface, context['constants'], context['attributes'], context['methods']), |
}) |
+ |
+ # Cross-origin interceptors |
+ has_cross_origin_named_getter = False |
+ has_cross_origin_named_setter = False |
+ has_cross_origin_indexed_getter = False |
haraken
2016/11/02 04:30:32
What about an indexed setter?
dcheng
2016/11/02 07:45:32
There are no cross-origin indexed setters. We can
Yuki
2016/11/02 08:26:39
I'm happy with raising an exception in the binding
dcheng
2016/11/03 07:44:45
I updated the bindings generator to raise exceptio
|
+ |
+ for attribute in attributes: |
+ if attribute['has_cross_origin_getter']: |
+ has_cross_origin_named_getter = True |
+ elif attribute['has_cross_origin_setter']: |
+ has_cross_origin_named_setter = True |
+ |
+ for method in methods: |
+ if method['is_cross_origin']: |
+ has_cross_origin_named_getter = True |
haraken
2016/11/02 04:30:32
Why do we treat cross-origin methods as named gett
dcheng
2016/11/02 07:45:32
Added a comment.
|
+ |
+ if context['named_property_getter'] and context['named_property_getter']['is_cross_origin']: |
+ has_cross_origin_named_getter = True |
+ |
+ if context['indexed_property_getter'] and context['indexed_property_getter']['is_cross_origin']: |
+ has_cross_origin_indexed_getter = True |
+ |
+ context.update({ |
+ 'has_cross_origin_named_getter': has_cross_origin_named_getter, |
+ 'has_cross_origin_named_setter': has_cross_origin_named_setter, |
+ 'has_cross_origin_indexed_getter': has_cross_origin_indexed_getter, |
+ }) |
+ |
return context |
@@ -791,19 +816,6 @@ def overloads_context(interface, overloads): |
maxarg = ('%sV8Internal::%sMethodMaxArg()' |
% (cpp_name_or_partial(interface), name)) |
- # Check and fail if overloads disagree on any of the extended attributes |
- # that affect how the method should be registered. |
- # Skip the check for overloaded constructors, since they don't support any |
- # of the extended attributes in question. |
- if not overloads[0].get('is_constructor'): |
- overload_extended_attributes = [ |
- method['custom_registration_extended_attributes'] |
- for method in overloads] |
- for extended_attribute in v8_methods.CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES: |
- if common_key(overload_extended_attributes, extended_attribute) is None: |
- raise ValueError('Overloads of %s have conflicting extended attribute %s' |
- % (name, extended_attribute)) |
- |
# Check and fail if overloads disagree about whether the return type |
# is a Promise or not. |
promise_overload_count = sum(1 for method in overloads if method.get('returns_promise')) |
@@ -828,7 +840,6 @@ def overloads_context(interface, overloads): |
return { |
'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'), |
'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 |
@@ -1392,8 +1403,8 @@ def property_getter(getter, cpp_arguments): |
return { |
'cpp_type': idl_type.cpp_type, |
'cpp_value': cpp_value, |
- 'do_not_check_security': 'DoNotCheckSecurity' in extended_attributes, |
'is_call_with_script_state': is_call_with_script_state, |
+ 'is_cross_origin': 'CrossOrigin' in extended_attributes, |
'is_custom': |
'Custom' in extended_attributes and |
(not extended_attributes['Custom'] or |