Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp |
| index 5852d683bb8b00753f17cc6b1823dba7353127ca..152837e8918314a11f64f719f2e53cc989387757 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp |
| @@ -81,13 +81,9 @@ void V8EventTarget::addEventListenerMethodCustom(const v8::FunctionCallbackInfo< |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventListener", "EventTarget", info.Holder(), info.GetIsolate()); |
| EventTarget* impl = V8EventTarget::toImpl(info.Holder()); |
| - if (LocalDOMWindow* window = impl->toDOMWindow()) { |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), window->frame(), exceptionState)) { |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - if (!window->document()) |
|
haraken
2015/11/16 11:34:21
Is it ok to remove this check?
Yuki
2015/11/20 12:27:52
Yes, it's okay because if |window| does not have t
|
| - return; |
| + if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl, exceptionState)) { |
| + exceptionState.throwIfNeeded(); |
| + return; |
| } |
| V8StringResource<TreatNullAsNullString> type; |
| RefPtrWillBeRawPtr<EventListener> listener; |
| @@ -127,13 +123,9 @@ void V8EventTarget::removeEventListenerMethodCustom(const v8::FunctionCallbackIn |
| { |
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEventListener", "EventTarget", info.Holder(), info.GetIsolate()); |
| EventTarget* impl = V8EventTarget::toImpl(info.Holder()); |
| - if (LocalDOMWindow* window = impl->toDOMWindow()) { |
| - if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), window->frame(), exceptionState)) { |
| - exceptionState.throwIfNeeded(); |
| - return; |
| - } |
| - if (!window->document()) |
|
haraken
2015/11/16 11:34:20
Ditto.
Yuki
2015/11/20 12:27:52
Ditto.
|
| - return; |
| + if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl, exceptionState)) { |
| + exceptionState.throwIfNeeded(); |
| + return; |
| } |
| V8StringResource<TreatNullAsNullString> type; |
| RefPtrWillBeRawPtr<EventListener> listener; |