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

Unified Diff: Source/bindings/v8/V8EventListenerList.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/v8/V8EventListener.cpp ('k') | Source/bindings/v8/V8EventListenerList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8EventListenerList.h
diff --git a/Source/bindings/v8/V8EventListenerList.h b/Source/bindings/v8/V8EventListenerList.h
index 4ff8619672934fe61478a3014323c56ab04cc2f1..ca59ca024edfbe3e07a68ac4329ac36c71388590 100644
--- a/Source/bindings/v8/V8EventListenerList.h
+++ b/Source/bindings/v8/V8EventListenerList.h
@@ -46,18 +46,18 @@ enum ListenerLookupType {
// This is a container for V8EventListener objects that uses hidden properties of v8::Object to speed up lookups.
class V8EventListenerList {
public:
- static PassRefPtr<V8EventListener> findWrapper(v8::Local<v8::Value> value, v8::Isolate* isolate)
+ static PassRefPtr<V8EventListener> findWrapper(v8::Local<v8::Value> value, ScriptState* scriptState)
{
- ASSERT(isolate->InContext());
+ ASSERT(scriptState->isolate()->InContext());
if (!value->IsObject())
return nullptr;
- v8::Handle<v8::String> wrapperProperty = getHiddenProperty(false, isolate);
- return doFindWrapper(v8::Local<v8::Object>::Cast(value), wrapperProperty, isolate);
+ v8::Handle<v8::String> wrapperProperty = getHiddenProperty(false, scriptState->isolate());
+ return doFindWrapper(v8::Local<v8::Object>::Cast(value), wrapperProperty, scriptState);
}
template<typename WrapperType>
- static PassRefPtr<V8EventListener> findOrCreateWrapper(v8::Local<v8::Value>, bool isAttribute, v8::Isolate*);
+ static PassRefPtr<V8EventListener> findOrCreateWrapper(v8::Local<v8::Value>, bool isAttribute, ScriptState*);
static void clearWrapper(v8::Handle<v8::Object> listenerObject, bool isAttribute, v8::Isolate* isolate)
{
@@ -68,10 +68,10 @@ public:
static PassRefPtr<EventListener> getEventListener(ScriptState*, v8::Local<v8::Value>, bool isAttribute, ListenerLookupType);
private:
- static V8EventListener* doFindWrapper(v8::Local<v8::Object> object, v8::Handle<v8::String> wrapperProperty, v8::Isolate* isolate)
+ static V8EventListener* doFindWrapper(v8::Local<v8::Object> object, v8::Handle<v8::String> wrapperProperty, ScriptState* scriptState)
{
- ASSERT(isolate->InContext());
- v8::HandleScope scope(isolate);
+ v8::HandleScope scope(scriptState->isolate());
+ ASSERT(scriptState->isolate()->InContext());
v8::Local<v8::Value> listener = object->GetHiddenValue(wrapperProperty);
if (listener.IsEmpty())
return 0;
@@ -85,8 +85,9 @@ private:
};
template<typename WrapperType>
-PassRefPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper(v8::Local<v8::Value> value, bool isAttribute, v8::Isolate* isolate)
+PassRefPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper(v8::Local<v8::Value> value, bool isAttribute, ScriptState* scriptState)
{
+ v8::Isolate* isolate = scriptState->isolate();
ASSERT(isolate->InContext());
if (!value->IsObject()
// Non-callable attribute setter input is treated as null (no wrapper)
@@ -96,11 +97,11 @@ PassRefPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper(v8::Local<v
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
v8::Handle<v8::String> wrapperProperty = getHiddenProperty(isAttribute, isolate);
- V8EventListener* wrapper = doFindWrapper(object, wrapperProperty, isolate);
+ V8EventListener* wrapper = doFindWrapper(object, wrapperProperty, scriptState);
if (wrapper)
return wrapper;
- RefPtr<V8EventListener> wrapperPtr = WrapperType::create(object, isAttribute, isolate);
+ RefPtr<V8EventListener> wrapperPtr = WrapperType::create(object, isAttribute, scriptState);
if (wrapperPtr)
object->SetHiddenValue(wrapperProperty, v8::External::New(isolate, wrapperPtr.get()));
« no previous file with comments | « Source/bindings/v8/V8EventListener.cpp ('k') | Source/bindings/v8/V8EventListenerList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698