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

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

Issue 794123004: Make TreeScopeEventContext have a RefPtr to TreeScope.rootNode to guard TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Yet another miinimization Created 6 years 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/TreeScopeEventContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/TreeScopeEventContext.cpp
diff --git a/Source/core/events/TreeScopeEventContext.cpp b/Source/core/events/TreeScopeEventContext.cpp
index 738193b791bdef042245c6367a4ac61e5f66422f..bdf4c0fbed4690d62932af0a6b500b38df85007c 100644
--- a/Source/core/events/TreeScopeEventContext.cpp
+++ b/Source/core/events/TreeScopeEventContext.cpp
@@ -42,8 +42,8 @@ PassRefPtrWillBeRawPtr<StaticNodeList> TreeScopeEventContext::ensureEventPath(Ev
WillBeHeapVector<RefPtrWillBeMember<Node>> nodes;
nodes.reserveInitialCapacity(path.size());
for (size_t i = 0; i < path.size(); ++i) {
- TreeScope& treeScope = path[i].treeScopeEventContext().treeScope();
- if (treeScope.rootNode().isShadowRoot() && toShadowRoot(treeScope).type() == ShadowRoot::AuthorShadowRoot)
+ Node& rootNode = path[i].treeScopeEventContext().rootNode();
+ if (rootNode.isShadowRoot() && toShadowRoot(rootNode).type() == ShadowRoot::AuthorShadowRoot)
nodes.append(path[i].node());
else if (path[i].treeScopeEventContext().isInclusiveAncestorOf(*this))
nodes.append(path[i].node());
@@ -66,6 +66,7 @@ PassRefPtrWillBeRawPtr<TreeScopeEventContext> TreeScopeEventContext::create(Tree
TreeScopeEventContext::TreeScopeEventContext(TreeScope& treeScope)
: m_treeScope(treeScope)
+ , m_rootNode(treeScope.rootNode())
, m_preOrder(-1)
, m_postOrder(-1)
{
@@ -76,6 +77,7 @@ DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(TreeScopeEventContext)
void TreeScopeEventContext::trace(Visitor* visitor)
{
visitor->trace(m_treeScope);
+ visitor->trace(m_rootNode);
visitor->trace(m_target);
visitor->trace(m_relatedTarget);
visitor->trace(m_eventPath);
« no previous file with comments | « Source/core/events/TreeScopeEventContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698