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

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

Issue 10909084: Merge 127117 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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 | « LayoutTests/fast/events/set-attribute-listener-window-onerror-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/V8AbstractEventListener.h
===================================================================
--- Source/WebCore/bindings/v8/V8AbstractEventListener.h (revision 127629)
+++ Source/WebCore/bindings/v8/V8AbstractEventListener.h (working copy)
@@ -79,6 +79,11 @@
// Returns the listener object, either a function or an object.
v8::Local<v8::Object> getListenerObject(ScriptExecutionContext* context)
{
+ // prepareListenerObject can potentially deref this event listener
+ // as it may attempt to compile a function (lazy event listener), get an error
+ // and invoke onerror callback which can execute arbitrary JS code.
+ // Protect this event listener to keep it alive.
+ RefPtr<V8AbstractEventListener> guard(this);
prepareListenerObject(context);
return v8::Local<v8::Object>::New(m_listener);
}
« no previous file with comments | « LayoutTests/fast/events/set-attribute-listener-window-onerror-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698