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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h

Issue 1419313003: Track the script state a listener was created in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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: third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h b/third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h
index b3de61342c043cbe58a4367bdc41f91ab218d5c5..30ed6df546ae110d21ed9929764f6ec8512f9710 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8EventListenerList.h
@@ -61,10 +61,11 @@ public:
template<typename WrapperType>
static PassRefPtrWillBeRawPtr<V8EventListener> findOrCreateWrapper(v8::Local<v8::Value>, bool isAttribute, ScriptState*);
- static void clearWrapper(v8::Local<v8::Object> listenerObject, bool isAttribute, v8::Isolate* isolate)
+ static void clearWrapper(v8::Local<v8::Object> listenerObject, bool isAttribute, ScriptState* scriptState)
{
- v8::Local<v8::String> wrapperProperty = getHiddenProperty(isAttribute, isolate);
- V8HiddenValue::deleteHiddenValue(isolate, listenerObject, wrapperProperty);
+ ASSERT(scriptState->isolate()->InContext());
+ v8::Local<v8::String> wrapperProperty = getHiddenProperty(isAttribute, scriptState->isolate());
+ V8HiddenValue::deleteHiddenValue(scriptState, listenerObject, wrapperProperty);
}
CORE_EXPORT static PassRefPtrWillBeRawPtr<EventListener> getEventListener(ScriptState*, v8::Local<v8::Value>, bool isAttribute, ListenerLookupType);
@@ -74,7 +75,7 @@ private:
{
v8::HandleScope scope(scriptState->isolate());
ASSERT(scriptState->isolate()->InContext());
- v8::Local<v8::Value> listener = V8HiddenValue::getHiddenValue(scriptState->isolate(), object, wrapperProperty);
+ v8::Local<v8::Value> listener = V8HiddenValue::getHiddenValue(scriptState, object, wrapperProperty);
if (listener.IsEmpty())
return 0;
return static_cast<V8EventListener*>(v8::External::Cast(*listener)->Value());
@@ -103,7 +104,7 @@ PassRefPtrWillBeRawPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper
RefPtrWillBeRawPtr<V8EventListener> wrapperPtr = WrapperType::create(object, isAttribute, scriptState);
if (wrapperPtr)
- V8HiddenValue::setHiddenValue(isolate, object, wrapperProperty, v8::External::New(isolate, wrapperPtr.get()));
+ V8HiddenValue::setHiddenValue(scriptState, object, wrapperProperty, v8::External::New(isolate, wrapperPtr.get()));
return wrapperPtr;
}

Powered by Google App Engine
This is Rietveld 408576698