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

Unified Diff: Source/core/events/EventTarget.h

Issue 307433003: Oilpan: Allocate all EventTarget derived types on the manged heap. (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
Index: Source/core/events/EventTarget.h
diff --git a/Source/core/events/EventTarget.h b/Source/core/events/EventTarget.h
index 8f7c238282c6b60496e82fb07be2ec55c186ba23..d33142313a6f988d365b6e1fea078833123ed0ff 100644
--- a/Source/core/events/EventTarget.h
+++ b/Source/core/events/EventTarget.h
@@ -72,7 +72,7 @@ public:
OwnPtr<FiringEventIteratorVector> firingEventIterators;
};
-class EventTarget {
+class EventTarget : public WillBeGarbageCollectedMixin {
public:
void ref() { refEventTarget(); }
void deref() { derefEventTarget(); }
@@ -110,6 +110,8 @@ public:
bool fireEventListeners(Event*);
+ virtual void trace(Visitor*) { }
+
protected:
virtual ~EventTarget();
@@ -223,6 +225,10 @@ private: \
// Use this macro if your EventTarget subclass is also a subclass of WTF::RefCounted.
// A ref-counted class that uses a different method of refcounting should use DEFINE_EVENT_TARGET_REFCOUNTING directly.
// Both of these macros are meant to be placed just before the "public:" section of the class declaration.
+#if ENABLE(OILPAN)
+#define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<className>)
+#else
#define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCounted<className>)
+#endif
haraken 2014/05/27 01:39:19 Can we write this: #define REFCOUNTED_EVENT_TARGE
zerny-chromium 2014/05/27 07:34:33 Yes, that is simpler :-) Done.
#endif // EventTarget_h

Powered by Google App Engine
This is Rietveld 408576698