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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 1673073003: Add assert to catch dispatching events over dying targets. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 15bd846035344ffc91e74802d52da4c5e6adea18..f0c63db706f3aec9ce49d35d6f09605bd361ec67 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -275,6 +275,13 @@ bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
bool EventTarget::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
{
+#if ENABLE(OILPAN)
+ // Dispatching events for a target that is about to be swept,
+ // is unsafe and not allowed. If this assert triggers, your
+ // EventTarget needs to extend its lifetime accordingly.
+ // Using mechanisms like e.g., ActiveDOMObject::hasPendingActivity().
+ ASSERT(!Heap::willObjectBeLazilySwept(this));
+#endif
event->setTarget(this);
event->setCurrentTarget(this);
event->setEventPhase(Event::AT_TARGET);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698