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

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

Issue 262093006: Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another build fix. Created 6 years, 7 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
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index f77d2fc50efc2ce5104b3acb611c25d02086e1ee..81a8d86ac5d5f642a00eb42db818412440038df1 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -56,7 +56,7 @@ namespace WebCore {
using namespace HTMLNames;
TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
- : m_rootNode(rootNode)
+ : m_rootNode(&rootNode)
, m_document(&document)
, m_parentTreeScope(&document)
#if !ENABLE(OILPAN)
@@ -68,7 +68,7 @@ TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
#if !ENABLE(OILPAN)
m_parentTreeScope->guardRef();
#endif
- m_rootNode.setTreeScope(this);
+ m_rootNode->setTreeScope(this);
}
TreeScope::TreeScope(Document& document)
@@ -80,17 +80,15 @@ TreeScope::TreeScope(Document& document)
#endif
, m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
{
- m_rootNode.setTreeScope(this);
+ m_rootNode->setTreeScope(this);
}
TreeScope::~TreeScope()
{
#if !ENABLE(OILPAN)
ASSERT(!m_guardRefCount);
-#endif
- m_rootNode.setTreeScope(0);
+ m_rootNode->setTreeScope(0);
-#if !ENABLE(OILPAN)
if (m_selection) {
m_selection->clearTreeScope();
m_selection = nullptr;
@@ -338,7 +336,9 @@ void TreeScope::adoptIfNeeded(Node& node)
{
ASSERT(this);
ASSERT(!node.isDocumentNode());
+#if !ENABLE(OILPAN)
ASSERT_WITH_SECURITY_IMPLICATION(!node.m_deletionHasBegun);
+#endif
TreeScopeAdopter adopter(node, *this);
if (adopter.needsScopeChange())
adopter.execute();
@@ -479,7 +479,7 @@ TreeScope* commonTreeScope(Node* nodeA, Node* nodeB)
return treeScopesA[indexA] == treeScopesB[indexB] ? treeScopesA[indexA] : 0;
}
-#if SECURITY_ASSERT_ENABLED
+#if SECURITY_ASSERT_ENABLED && !ENABLE(OILPAN)
bool TreeScope::deletionHasBegun()
{
return rootNode().m_deletionHasBegun;
@@ -491,10 +491,12 @@ void TreeScope::beginDeletion()
}
#endif
+#if !ENABLE(OILPAN)
int TreeScope::refCount() const
{
return rootNode().refCount();
}
+#endif
bool TreeScope::isInclusiveAncestorOf(const TreeScope& scope) const
{
@@ -535,6 +537,8 @@ void TreeScope::setNeedsStyleRecalcForViewportUnits()
void TreeScope::trace(Visitor* visitor)
{
+ visitor->trace(m_rootNode);
+ visitor->trace(m_document);
visitor->trace(m_parentTreeScope);
visitor->trace(m_selection);
}

Powered by Google App Engine
This is Rietveld 408576698