Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: Source/bindings/core/v8/V8EventListener.cpp

Issue 823263002: ScriptState used by EventListener::handleEvent() is wrong (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/V8EventListener.cpp
diff --git a/Source/bindings/core/v8/V8EventListener.cpp b/Source/bindings/core/v8/V8EventListener.cpp
index 73d710865bea229be6e8d2aa62cbfea572280b2d..7d705d5b41454487514f47f909cfe1c6df260953 100644
--- a/Source/bindings/core/v8/V8EventListener.cpp
+++ b/Source/bindings/core/v8/V8EventListener.cpp
@@ -39,14 +39,14 @@
namespace blink {
V8EventListener::V8EventListener(v8::Local<v8::Object> listener, bool isAttribute, ScriptState* scriptState)
- : V8AbstractEventListener(isAttribute, scriptState)
+ : V8AbstractEventListener(isAttribute, scriptState->world(), scriptState->isolate())
{
setListenerObject(listener);
}
-v8::Local<v8::Function> V8EventListener::getListenerFunction(ExecutionContext*)
+v8::Local<v8::Function> V8EventListener::getListenerFunction(ScriptState* scriptState)
{
- v8::Local<v8::Object> listener = getListenerObject(scriptState()->executionContext());
+ v8::Local<v8::Object> listener = getListenerObject(scriptState->executionContext());
// Has the listener been disposed?
if (listener.IsEmpty())
@@ -67,17 +67,17 @@ v8::Local<v8::Function> V8EventListener::getListenerFunction(ExecutionContext*)
return v8::Local<v8::Function>();
}
-v8::Local<v8::Value> V8EventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
+v8::Local<v8::Value> V8EventListener::callListenerFunction(ScriptState* scriptState, v8::Handle<v8::Value> jsEvent, Event* event)
{
- v8::Local<v8::Function> handlerFunction = getListenerFunction(scriptState()->executionContext());
- v8::Local<v8::Object> receiver = getReceiverObject(event);
+ v8::Local<v8::Function> handlerFunction = getListenerFunction(scriptState);
+ v8::Local<v8::Object> receiver = getReceiverObject(scriptState, event);
if (handlerFunction.IsEmpty() || receiver.IsEmpty())
return v8::Local<v8::Value>();
- if (!scriptState()->executionContext()->isDocument())
+ if (!scriptState->executionContext()->isDocument())
return v8::Local<v8::Value>();
- LocalFrame* frame = toDocument(scriptState()->executionContext())->frame();
+ LocalFrame* frame = toDocument(scriptState->executionContext())->frame();
if (!frame)
return v8::Local<v8::Value>();

Powered by Google App Engine
This is Rietveld 408576698