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

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

Issue 1157933002: Oilpan: introduce eager finalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Parameterize Heap::poisonHeap() over ObjectsToPoison Created 5 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/core/dom/Node.h ('k') | Source/platform/heap/GarbageCollected.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventTarget.h
diff --git a/Source/core/events/EventTarget.h b/Source/core/events/EventTarget.h
index 1b33c2c444d5a8d52f2c334b82b2f1a5210c7f85..8af426ddb8137784491b45e684d2cc49232344b3 100644
--- a/Source/core/events/EventTarget.h
+++ b/Source/core/events/EventTarget.h
@@ -196,7 +196,18 @@ private:
// #if-switch here, in order to avoid a lot of "#if ENABLE(OILPAN)"-s sprinkled in the derived classes.
#if ENABLE(OILPAN)
template <typename T>
-class RefCountedGarbageCollectedEventTargetWithInlineData : public EventTargetWithInlineData { };
+class RefCountedGarbageCollectedEventTargetWithInlineData : public EventTargetWithInlineData {
+public:
+ GC_PLUGIN_IGNORE("491488")
+ void* operator new(size_t size)
+ {
+ // If T is eagerly finalized, it needs to be allocated accordingly.
+ // Redefinition of the operator is needed to accomplish that, as otherwise
+ // it would be allocated using GarbageCollected<EventTarget>'s operator new.
+ // EventTarget is not eagerly finalized.
+ return allocateObject(size, IsEagerlyFinalizedType<T>::value);
+ }
+};
#else
template <typename T>
class RefCountedGarbageCollectedEventTargetWithInlineData : public RefCountedGarbageCollected<T>, public EventTargetWithInlineData {
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/platform/heap/GarbageCollected.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698