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

Unified Diff: Source/core/dom/Node.cpp

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.h ('k') | Source/core/events/EventTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 89a1bc4bef41755f219b6a59a7d310da52cbb722..4551b65782c60d52aa0a66ad27c190c6100b2f63 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -2104,14 +2104,14 @@ EventTargetData* Node::eventTargetData()
return hasEventTargetData() ? eventTargetDataMap().get(this) : 0;
}
-EventTargetData* Node::ensureEventTargetData()
+EventTargetData& Node::ensureEventTargetData()
{
if (hasEventTargetData())
- return eventTargetDataMap().get(this);
+ return *eventTargetDataMap().get(this);
setHasEventTargetData(true);
EventTargetData* data = new EventTargetData;
eventTargetDataMap().set(this, adoptPtr(data));
- return data;
+ return *data;
}
void Node::clearEventTargetData()
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/events/EventTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698