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

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

Issue 1876843002: Introduce few const getters for dom classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/events/EventListenerMap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 78ab5e3ad08519f8cf1b09af1f4f41dab355e0bf..2547443457442477a9445ea392d598c18d2af1c8 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -339,6 +339,11 @@ NodeRareData* Node::rareData() const
return static_cast<NodeRareData*>(m_data.m_rareData);
}
+NodeRareData* Node::maybeRareData() const
+{
+ return hasRareData() ? rareData() : nullptr;
+}
+
NodeRareData& Node::ensureRareData()
{
if (hasRareData())
@@ -1892,14 +1897,14 @@ void Node::removeAllEventListenersRecursively()
}
}
-using EventTargetDataMap = HeapHashMap<WeakMember<Node>, Member<EventTargetData>>;
+using EventTargetDataMap = HeapHashMap<WeakMember<const Node>, Member<EventTargetData>>;
static EventTargetDataMap& eventTargetDataMap()
{
DEFINE_STATIC_LOCAL(EventTargetDataMap, map, (new EventTargetDataMap));
return map;
}
-EventTargetData* Node::eventTargetData()
+EventTargetData* Node::eventTargetData() const
{
return hasEventTargetData() ? eventTargetDataMap().get(this) : nullptr;
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/events/EventListenerMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698