Index: Source/core/events/EventTarget.h |
diff --git a/Source/core/events/EventTarget.h b/Source/core/events/EventTarget.h |
index 35d209af6112b87233bcd4e2af4e88490922d75a..ee9799bab116b2cd2175aabda7a7144a408a9aec 100644 |
--- a/Source/core/events/EventTarget.h |
+++ b/Source/core/events/EventTarget.h |
@@ -131,7 +131,7 @@ namespace WebCore { |
virtual ~EventTarget(); |
virtual EventTargetData* eventTargetData() = 0; |
- virtual EventTargetData* ensureEventTargetData() = 0; |
+ virtual EventTargetData& ensureEventTargetData() = 0; |
private: |
virtual void refEventTarget() = 0; |
@@ -146,6 +146,14 @@ namespace WebCore { |
friend class EventListenerIterator; |
}; |
+ class EventTargetWithInlineData : public EventTarget { |
+ protected: |
+ virtual EventTargetData* eventTargetData() OVERRIDE FINAL { return &m_eventTargetData; } |
+ virtual EventTargetData& ensureEventTargetData() OVERRIDE FINAL { return m_eventTargetData; } |
+ private: |
+ EventTargetData m_eventTargetData; |
+ }; |
+ |
// FIXME: These macros should be split into separate DEFINE and DECLARE |
// macros to avoid causing so many header includes. |
#define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \ |