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

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

Issue 293053007: V8AbstractEventListener should hold a ScriptState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/bindings/v8/V8EventListener.h ('k') | Source/bindings/v8/V8EventListenerList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8EventListener.cpp
diff --git a/Source/bindings/v8/V8EventListener.cpp b/Source/bindings/v8/V8EventListener.cpp
index 207bdf5c5f0560fe463e1ad8daecbd2b3e5810b6..9b3171793e724f637fb8c158e793d30b953a9754 100644
--- a/Source/bindings/v8/V8EventListener.cpp
+++ b/Source/bindings/v8/V8EventListener.cpp
@@ -38,15 +38,15 @@
namespace WebCore {
-V8EventListener::V8EventListener(v8::Local<v8::Object> listener, bool isAttribute, v8::Isolate* isolate)
- : V8AbstractEventListener(isAttribute, DOMWrapperWorld::current(isolate), isolate)
+V8EventListener::V8EventListener(v8::Local<v8::Object> listener, bool isAttribute, ScriptState* scriptState)
+ : V8AbstractEventListener(isAttribute, scriptState)
{
setListenerObject(listener);
}
-v8::Local<v8::Function> V8EventListener::getListenerFunction(ExecutionContext* context)
+v8::Local<v8::Function> V8EventListener::getListenerFunction(ExecutionContext*)
{
- v8::Local<v8::Object> listener = getListenerObject(context);
+ v8::Local<v8::Object> listener = getListenerObject(scriptState()->executionContext());
// Has the listener been disposed?
if (listener.IsEmpty())
@@ -67,22 +67,18 @@ v8::Local<v8::Function> V8EventListener::getListenerFunction(ExecutionContext* c
return v8::Local<v8::Function>();
}
-v8::Local<v8::Value> V8EventListener::callListenerFunction(ExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
+v8::Local<v8::Value> V8EventListener::callListenerFunction(ExecutionContext*, v8::Handle<v8::Value> jsEvent, Event* event)
{
- v8::Local<v8::Function> handlerFunction = getListenerFunction(context);
- v8::Local<v8::Object> receiver = getReceiverObject(context, event);
+ v8::Local<v8::Function> handlerFunction = getListenerFunction(scriptState()->executionContext());
+ v8::Local<v8::Object> receiver = getReceiverObject(event);
if (handlerFunction.IsEmpty() || receiver.IsEmpty())
return v8::Local<v8::Value>();
- // FIXME: Can |context| be 0 here?
- if (!context)
+ if (!scriptState()->executionContext()->isDocument())
return v8::Local<v8::Value>();
- if (!context->isDocument())
- return v8::Local<v8::Value>();
-
- LocalFrame* frame = toDocument(context)->frame();
+ LocalFrame* frame = toDocument(scriptState()->executionContext())->frame();
if (!frame)
return v8::Local<v8::Value>();
« no previous file with comments | « Source/bindings/v8/V8EventListener.h ('k') | Source/bindings/v8/V8EventListenerList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698