| Index: Source/core/dom/TreeScope.cpp
|
| diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
|
| index db31ceb360569d897ab1670417a8ecc28e2ba6ab..f6ba17ef6c8fd17bd0a909a038aea6ea790961f9 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,7 +85,9 @@ TreeScope::TreeScope(Document& document)
|
|
|
| TreeScope::~TreeScope()
|
| {
|
| +#if !ENABLE(OILPAN)
|
| ASSERT(!m_guardRefCount);
|
| +#endif
|
| m_rootNode.setTreeScope(0);
|
|
|
| if (m_selection) {
|
| @@ -87,8 +95,10 @@ TreeScope::~TreeScope()
|
| m_selection = nullptr;
|
| }
|
|
|
| +#if !ENABLE(OILPAN)
|
| 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());
|
| }
|
| @@ -495,4 +507,9 @@ void TreeScope::setNeedsStyleRecalcForViewportUnits()
|
| }
|
| }
|
|
|
| +void TreeScope::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_parentTreeScope);
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|