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

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

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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
Index: Source/core/events/EventTarget.h
diff --git a/Source/core/events/EventTarget.h b/Source/core/events/EventTarget.h
index 28f7545e132035cc3186926237279e8c2e10f742..63230369ee0a3bb430288e2f7421633eb0e60d26 100644
--- a/Source/core/events/EventTarget.h
+++ b/Source/core/events/EventTarget.h
@@ -162,26 +162,26 @@ private:
void setOn##attribute(PassRefPtr<EventListener> listener) { setAttributeEventListener(EventTypeNames::attribute, listener); } \
#define DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(attribute) \
- static EventListener* on##attribute(EventTarget* eventTarget) { return eventTarget->getAttributeEventListener(EventTypeNames::attribute); } \
- static void setOn##attribute(EventTarget* eventTarget, PassRefPtr<EventListener> listener) { eventTarget->setAttributeEventListener(EventTypeNames::attribute, listener); } \
+ static EventListener* on##attribute(EventTarget& eventTarget) { return eventTarget.getAttributeEventListener(EventTypeNames::attribute); } \
+ static void setOn##attribute(EventTarget& eventTarget, PassRefPtr<EventListener> listener) { eventTarget.setAttributeEventListener(EventTypeNames::attribute, listener); } \
#define DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(attribute) \
EventListener* on##attribute() { return document().getWindowAttributeEventListener(EventTypeNames::attribute); } \
void setOn##attribute(PassRefPtr<EventListener> listener) { document().setWindowAttributeEventListener(EventTypeNames::attribute, listener); } \
#define DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(attribute) \
- static EventListener* on##attribute(EventTarget* eventTarget) { \
- if (Node* node = eventTarget->toNode()) \
+ static EventListener* on##attribute(EventTarget& eventTarget) { \
+ if (Node* node = eventTarget.toNode()) \
return node->document().getWindowAttributeEventListener(EventTypeNames::attribute); \
- ASSERT(eventTarget->toDOMWindow()); \
- return eventTarget->getAttributeEventListener(EventTypeNames::attribute); \
+ ASSERT(eventTarget.toDOMWindow()); \
+ return eventTarget.getAttributeEventListener(EventTypeNames::attribute); \
} \
- static void setOn##attribute(EventTarget* eventTarget, PassRefPtr<EventListener> listener) { \
- if (Node* node = eventTarget->toNode()) \
+ static void setOn##attribute(EventTarget& eventTarget, PassRefPtr<EventListener> listener) { \
+ if (Node* node = eventTarget.toNode()) \
node->document().setWindowAttributeEventListener(EventTypeNames::attribute, listener); \
else { \
- ASSERT(eventTarget->toDOMWindow()); \
- eventTarget->setAttributeEventListener(EventTypeNames::attribute, listener); \
+ ASSERT(eventTarget.toDOMWindow()); \
+ eventTarget.setAttributeEventListener(EventTypeNames::attribute, listener); \
} \
}

Powered by Google App Engine
This is Rietveld 408576698