| 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 3b3fc0d7cfa47d80fd8cef9faf6455d8356f6fc9..d7bc424aceae00c47e0c019f4040f5c14bbb1d24 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())
|
| - 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())
|
| - return;
|
| + if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl, exceptionState)) {
|
| + exceptionState.throwIfNeeded();
|
| + return;
|
| }
|
| V8StringResource<TreatNullAsNullString> type;
|
| RefPtrWillBeRawPtr<EventListener> listener;
|
|
|