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

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

Issue 235113002: Oilpan: Remove guardRef and guardDeref from TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 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 | « Source/core/dom/TreeScope.h ('k') | Source/core/dom/TreeScopeAdopter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index e80a7edf3f875131ed2ecd177769afe4e4e849e6..f77d2fc50efc2ce5104b3acb611c25d02086e1ee 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -59,19 +59,25 @@ TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
: m_rootNode(rootNode)
, m_document(&document)
, m_parentTreeScope(&document)
+#if !ENABLE(OILPAN)
, m_guardRefCount(0)
+#endif
, m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
{
ASSERT(rootNode != document);
+#if !ENABLE(OILPAN)
m_parentTreeScope->guardRef();
+#endif
m_rootNode.setTreeScope(this);
}
TreeScope::TreeScope(Document& document)
: m_rootNode(document)
, m_document(&document)
- , m_parentTreeScope(0)
+ , m_parentTreeScope(nullptr)
+#if !ENABLE(OILPAN)
, m_guardRefCount(0)
+#endif
, m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
{
m_rootNode.setTreeScope(this);
@@ -79,9 +85,12 @@ TreeScope::TreeScope(Document& document)
TreeScope::~TreeScope()
{
+#if !ENABLE(OILPAN)
ASSERT(!m_guardRefCount);
+#endif
m_rootNode.setTreeScope(0);
+#if !ENABLE(OILPAN)
if (m_selection) {
m_selection->clearTreeScope();
m_selection = nullptr;
@@ -89,6 +98,7 @@ TreeScope::~TreeScope()
if (m_parentTreeScope)
m_parentTreeScope->guardDeref();
+#endif
}
TreeScope* TreeScope::olderShadowRootOrParentTreeScope() const
@@ -126,9 +136,11 @@ void TreeScope::setParentTreeScope(TreeScope& newParentScope)
// A document node cannot be re-parented.
ASSERT(!rootNode().isDocumentNode());
+#if !ENABLE(OILPAN)
newParentScope.guardRef();
if (m_parentTreeScope)
m_parentTreeScope->guardDeref();
+#endif
m_parentTreeScope = &newParentScope;
setDocument(newParentScope.document());
}
@@ -521,4 +533,10 @@ void TreeScope::setNeedsStyleRecalcForViewportUnits()
}
}
+void TreeScope::trace(Visitor* visitor)
+{
+ visitor->trace(m_parentTreeScope);
+ visitor->trace(m_selection);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | Source/core/dom/TreeScopeAdopter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698