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

Unified Diff: Source/bindings/v8/V8AbstractEventListener.h

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/scripts/v8_attributes.py ('k') | Source/bindings/v8/V8AbstractEventListener.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8AbstractEventListener.h
diff --git a/Source/bindings/v8/V8AbstractEventListener.h b/Source/bindings/v8/V8AbstractEventListener.h
index ecae8f13b16c0ea1acd26013a661ac6c3c8aaa1d..ea5c60bba08c0ce3835ef1c877534491a9dff8a4 100644
--- a/Source/bindings/v8/V8AbstractEventListener.h
+++ b/Source/bindings/v8/V8AbstractEventListener.h
@@ -109,20 +109,27 @@ namespace WebCore {
}
virtual bool belongsToTheCurrentWorld() const OVERRIDE FINAL;
- DOMWrapperWorld& world() const { return *m_world; }
v8::Isolate* isolate() const { return m_isolate; }
+ virtual DOMWrapperWorld& world() const { return scriptState()->world(); }
+ ScriptState* scriptState() const
+ {
+ ASSERT(m_scriptState);
+ return m_scriptState.get();
+ }
+ void setScriptState(ScriptState* scriptState) { m_scriptState = scriptState; }
protected:
- V8AbstractEventListener(bool isAttribute, DOMWrapperWorld&, v8::Isolate*);
+ V8AbstractEventListener(bool isAttribute, ScriptState*);
+ V8AbstractEventListener(bool isAttribute, v8::Isolate*);
virtual void prepareListenerObject(ExecutionContext*) { }
void setListenerObject(v8::Handle<v8::Object> listener);
- void invokeEventHandler(ExecutionContext*, Event*, v8::Local<v8::Value> jsEvent);
+ void invokeEventHandler(Event*, v8::Local<v8::Value> jsEvent);
// Get the receiver object to use for event listener call.
- v8::Local<v8::Object> getReceiverObject(ExecutionContext*, Event*);
+ v8::Local<v8::Object> getReceiverObject(Event*);
private:
// Implementation of EventListener function.
@@ -139,7 +146,10 @@ namespace WebCore {
// Indicates if this is an HTML type listener.
bool m_isAttribute;
- RefPtr<DOMWrapperWorld> m_world;
+ // For V8LazyEventListener, m_scriptState can be 0 until V8LazyEventListener is actually used.
+ // m_scriptState is set lazily because V8LazyEventListener doesn't know the associated frame
+ // until the listener is actually used.
+ RefPtr<ScriptState> m_scriptState;
v8::Isolate* m_isolate;
};
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/v8/V8AbstractEventListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698