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

Unified Diff: Source/core/events/EventPath.cpp

Issue 336463002: Oilpan: Improve Oilpan support in EventContext and EventPath. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: FINAL Created 6 years, 6 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/events/EventPath.h ('k') | Source/core/events/NodeEventContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventPath.cpp
diff --git a/Source/core/events/EventPath.cpp b/Source/core/events/EventPath.cpp
index 8b6f74e9d73118122461f17cba78491b5ebafcb0..a783408fe51dc5b2a3ecdda0f98a51e87a16631c 100644
--- a/Source/core/events/EventPath.cpp
+++ b/Source/core/events/EventPath.cpp
@@ -88,7 +88,7 @@ static inline EventDispatchBehavior determineDispatchBehavior(Event* event, Shad
}
EventPath::EventPath(Event* event)
- : m_node(0)
+ : m_node(nullptr)
, m_event(event)
{
}
@@ -121,7 +121,7 @@ void EventPath::calculatePath()
{
ASSERT(m_node);
ASSERT(m_nodeEventContexts.isEmpty());
- m_node->document().updateDistributionForNodeIfNeeded(const_cast<Node*>(m_node));
+ m_node->document().updateDistributionForNodeIfNeeded(const_cast<Node*>(m_node.get()));
Node* current = m_node;
addNodeEventContext(current);
@@ -162,7 +162,7 @@ void EventPath::calculateTreeScopePrePostOrderNumbers()
// Precondition:
// - TreeScopes in m_treeScopeEventContexts must be *connected* in the same tree of trees.
// - The root tree must be included.
- HashMap<const TreeScope*, TreeScopeEventContext*> treeScopeEventContextMap;
+ WillBeHeapHashMap<RawPtrWillBeMember<const TreeScope>, RawPtrWillBeMember<TreeScopeEventContext> > treeScopeEventContextMap;
for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i)
treeScopeEventContextMap.add(&m_treeScopeEventContexts[i]->treeScope(), m_treeScopeEventContexts[i].get());
TreeScopeEventContext* rootTree = 0;
@@ -249,7 +249,7 @@ void EventPath::buildRelatedNodeMap(const Node* relatedNode, RelatedTargetMap& r
EventTarget* EventPath::findRelatedNode(TreeScope* scope, RelatedTargetMap& relatedTargetMap)
{
- Vector<TreeScope*, 32> parentTreeScopes;
+ WillBeHeapVector<RawPtrWillBeMember<TreeScope>, 32> parentTreeScopes;
EventTarget* relatedNode = 0;
while (scope) {
parentTreeScopes.append(scope);
@@ -261,7 +261,7 @@ EventTarget* EventPath::findRelatedNode(TreeScope* scope, RelatedTargetMap& rela
scope = scope->olderShadowRootOrParentTreeScope();
}
ASSERT(relatedNode);
- for (Vector<TreeScope*, 32>::iterator iter = parentTreeScopes.begin(); iter < parentTreeScopes.end(); ++iter)
+ for (WillBeHeapVector<RawPtrWillBeMember<TreeScope>, 32>::iterator iter = parentTreeScopes.begin(); iter < parentTreeScopes.end(); ++iter)
relatedTargetMap.add(*iter, relatedNode);
return relatedNode;
}
@@ -317,7 +317,7 @@ void EventPath::adjustForTouchEvent(Node* node, TouchEvent& touchEvent)
WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouches;
WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTargetTouches;
WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedChangedTouches;
- Vector<TreeScope*> treeScopes;
+ WillBeHeapVector<RawPtrWillBeMember<TreeScope> > treeScopes;
for (size_t i = 0; i < m_treeScopeEventContexts.size(); ++i) {
TouchEventContext* touchEventContext = m_treeScopeEventContexts[i]->ensureTouchEventContext();
@@ -342,7 +342,7 @@ void EventPath::adjustForTouchEvent(Node* node, TouchEvent& touchEvent)
#endif
}
-void EventPath::adjustTouchList(const Node* node, const TouchList* touchList, WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouchList, const Vector<TreeScope*>& treeScopes)
+void EventPath::adjustTouchList(const Node* node, const TouchList* touchList, WillBeHeapVector<RawPtrWillBeMember<TouchList> > adjustedTouchList, const WillBeHeapVector<RawPtrWillBeMember<TreeScope> >& treeScopes)
{
if (!touchList)
return;
@@ -367,7 +367,9 @@ void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList)
void EventPath::trace(Visitor* visitor)
{
visitor->trace(m_nodeEventContexts);
+ visitor->trace(m_node);
visitor->trace(m_event);
+ visitor->trace(m_treeScopeEventContexts);
}
} // namespace
« no previous file with comments | « Source/core/events/EventPath.h ('k') | Source/core/events/NodeEventContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698