Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/attributes.cpp |
| diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp b/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| index e50f24a0b38506db6a76d696f8dfb639d028c6f4..4550591e6e9c23f4ff5c29c25765cf396eeb01af 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| @@ -77,31 +77,16 @@ const v8::FunctionCallbackInfo<v8::Value>& info |
| {% endif %} |
| {# Security checks #} |
| {% if not attribute.is_data_type_property %} |
| - {% if attribute.is_check_security_for_window %} |
| - if (LocalDOMWindow* window = impl->toDOMWindow()) { |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), window->frame(), exceptionState)) { |
| - v8SetReturnValueNull(info); |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - if (!window->document()) |
|
haraken
2015/11/16 11:34:21
Is it okay to remove this check?
Yuki
2015/11/20 12:27:52
Yes, because shouldAllowAccessToFrame always fails
|
| - return; |
| - } |
| - {% elif attribute.is_check_security_for_frame %} |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl->frame(), exceptionState)) { |
| + {% if attribute.is_check_security_for_window or |
| + attribute.is_check_security_for_frame or |
| + attribute.is_check_security_for_node %} |
| + if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), {{attribute.cpp_value if attribute.is_check_security_for_node else 'impl'}}, exceptionState)) { |
| v8SetReturnValueNull(info); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| {% endif %} |
| {% endif %} |
| - {% if attribute.is_check_security_for_node %} |
| - if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), {{attribute.cpp_value}}, exceptionState)) { |
| - v8SetReturnValueNull(info); |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - {% endif %} |
| {% if attribute.reflect_only %} |
| {{release_only_check(attribute.reflect_only, attribute.reflect_missing, |
| attribute.reflect_invalid, attribute.reflect_empty, |
| @@ -298,31 +283,16 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info |
| {% if not attribute.is_replaceable and |
| not attribute.constructor_type %} |
| {% if not attribute.is_data_type_property %} |
| - {% if attribute.is_check_security_for_window %} |
| - if (LocalDOMWindow* window = impl->toDOMWindow()) { |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), window->frame(), exceptionState)) { |
| - v8SetReturnValue(info, v8Value); |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - if (!window->document()) |
|
haraken
2015/11/16 11:34:21
Ditto.
Yuki
2015/11/20 12:27:52
Ditto.
|
| - return; |
| - } |
| - {% elif attribute.is_check_security_for_frame %} |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl->frame(), exceptionState)) { |
| + {% if attribute.is_check_security_for_window or |
| + attribute.is_check_security_for_frame or |
| + attribute.is_check_security_for_node %} |
| + if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), {{attribute.cpp_value if attribute.is_check_security_for_node else 'impl'}}, exceptionState)) { |
| v8SetReturnValue(info, v8Value); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| {% endif %} |
| {% endif %} |
| - {% if attribute.is_check_security_for_node %} |
| - if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), {{attribute.cpp_value}}, exceptionState)) { |
| - v8SetReturnValue(info, v8Value); |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - {% endif %} |
| {% endif %}{# not attribute.is_replaceable and |
| not attribute.constructor_type #} |
| {# Convert JS value to C++ value #} |