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

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

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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.cpp ('k') | Source/core/events/EventTarget.cpp » ('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 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) \
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698