diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp b/chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp index 0606fb69fa6..ad44ef8bd1f 100644 --- a/chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp +++ b/chromium/third_party/WebKit/Source/bindings/v8/V8EventListenerList.cpp @@ -31,27 +31,24 @@ #include "config.h" #include "bindings/v8/V8EventListenerList.h" -#include "V8Window.h" +#include "bindings/core/v8/V8Window.h" #include "bindings/v8/V8Binding.h" #include "bindings/v8/V8WorkerGlobalScopeEventListener.h" namespace WebCore { -PassRefPtr<EventListener> V8EventListenerList::getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup) +PassRefPtr<EventListener> V8EventListenerList::getEventListener(ScriptState* scriptState, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Handle<v8::Context> context = isolate->GetCurrentContext(); - if (context.IsEmpty()) - return 0; + ASSERT(!scriptState->contextIsEmpty()); if (lookup == ListenerFindOnly) { // Used by EventTarget::removeEventListener, specifically // EventTargetV8Internal::removeEventListenerMethod ASSERT(!isAttribute); - return V8EventListenerList::findWrapper(value, isolate); + return V8EventListenerList::findWrapper(value, scriptState); } - if (V8DOMWrapper::isWrapperOfType(toInnerGlobalObject(context), &V8Window::wrapperTypeInfo)) - return V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute, isolate); - return V8EventListenerList::findOrCreateWrapper<V8WorkerGlobalScopeEventListener>(value, isAttribute, isolate); + if (toDOMWindow(scriptState->context())) + return V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute, scriptState); + return V8EventListenerList::findOrCreateWrapper<V8WorkerGlobalScopeEventListener>(value, isAttribute, scriptState); } } // namespace WebCore |