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

Side by Side Diff: Source/core/events/EventPath.h

Issue 182683002: Lazy evaluation of event.path by numbering TreeScopes in DFS order for later O(1) queries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more renaming Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/events/Event.cpp ('k') | Source/core/events/EventPath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 private: 69 private:
70 EventPath(); 70 EventPath();
71 71
72 NodeEventContext& at(size_t index) { return m_nodeEventContexts[index]; } 72 NodeEventContext& at(size_t index) { return m_nodeEventContexts[index]; }
73 73
74 void addNodeEventContext(Node*); 74 void addNodeEventContext(Node*);
75 75
76 void calculatePath(); 76 void calculatePath();
77 void calculateAdjustedTargets(); 77 void calculateAdjustedTargets();
78 void calculateAdjustedEventPath(); 78 void calculateTreeScopePrePostOrderNumbers();
79 79
80 void shrink(size_t newSize) { m_nodeEventContexts.shrink(newSize); } 80 void shrink(size_t newSize) { m_nodeEventContexts.shrink(newSize); }
81 void shrinkIfNeeded(const Node* target, const EventTarget* relatedTarget); 81 void shrinkIfNeeded(const Node* target, const EventTarget* relatedTarget);
82 82
83 void adjustTouchList(const Node*, const TouchList*, WillBeHeapVector<RawPtrW illBeMember<TouchList> > adjustedTouchList, const Vector<TreeScope*>& treeScopes ); 83 void adjustTouchList(const Node*, const TouchList*, WillBeHeapVector<RawPtrW illBeMember<TouchList> > adjustedTouchList, const Vector<TreeScope*>& treeScopes );
84 84
85 typedef HashMap<TreeScope*, RefPtr<TreeScopeEventContext> > TreeScopeEventCo ntextMap; 85 typedef HashMap<TreeScope*, RefPtr<TreeScopeEventContext> > TreeScopeEventCo ntextMap;
86 TreeScopeEventContext* ensureTreeScopeEventContext(Node* currentTarget, Tree Scope*, TreeScopeEventContextMap&); 86 TreeScopeEventContext* ensureTreeScopeEventContext(Node* currentTarget, Tree Scope*, TreeScopeEventContextMap&);
87 87
88 typedef HashMap<TreeScope*, EventTarget*> RelatedTargetMap; 88 typedef HashMap<TreeScope*, EventTarget*> RelatedTargetMap;
89 89
90 static void buildRelatedNodeMap(const Node*, RelatedTargetMap&); 90 static void buildRelatedNodeMap(const Node*, RelatedTargetMap&);
91 static EventTarget* findRelatedNode(TreeScope*, RelatedTargetMap&); 91 static EventTarget* findRelatedNode(TreeScope*, RelatedTargetMap&);
92 92
93 #ifndef NDEBUG 93 #ifndef NDEBUG
94 static void checkReachability(TreeScope&, TouchList&); 94 static void checkReachability(TreeScope&, TouchList&);
95 #endif 95 #endif
96 96
97 Vector<NodeEventContext, 64> m_nodeEventContexts; 97 Vector<NodeEventContext, 64> m_nodeEventContexts;
98 Node* m_node; 98 Node* m_node;
99 Event* m_event; 99 Event* m_event;
100 Vector<RefPtr<TreeScopeEventContext> > m_treeScopeEventContexts; 100 Vector<RefPtr<TreeScopeEventContext> > m_treeScopeEventContexts;
101 }; 101 };
102 102
103 } // namespace 103 } // namespace
104 104
105 #endif 105 #endif
OLDNEW
« no previous file with comments | « Source/core/events/Event.cpp ('k') | Source/core/events/EventPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698