| Index: Source/core/dom/Node.cpp
|
| diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
|
| index cba038b6cca06edabba595937d870d29f262089b..a91dae032d0c5da4468b38457ea023da5e51839e 100644
|
| --- a/Source/core/dom/Node.cpp
|
| +++ b/Source/core/dom/Node.cpp
|
| @@ -275,14 +275,17 @@ Node::~Node()
|
| if (m_next)
|
| m_next->setPreviousSibling(0);
|
|
|
| +#if !ENABLE(OILPAN)
|
| if (m_treeScope)
|
| m_treeScope->guardDeref();
|
| +#endif
|
|
|
| InspectorCounters::decrementCounter(InspectorCounters::NodeCounter);
|
| }
|
|
|
| void Node::willBeDeletedFromDocument()
|
| {
|
| +#if !ENABLE(OILPAN)
|
| if (!isTreeScopeInitialized())
|
| return;
|
|
|
| @@ -297,6 +300,7 @@ void Node::willBeDeletedFromDocument()
|
| cache->remove(this);
|
|
|
| document.markers().removeMarkers(this);
|
| +#endif
|
| }
|
|
|
| NodeRareData* Node::rareData() const
|
| @@ -2009,12 +2013,17 @@ void Node::removeAllEventListenersRecursively()
|
| }
|
| }
|
|
|
| -typedef HashMap<Node*, OwnPtr<EventTargetData> > EventTargetDataMap;
|
| +typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Node>, OwnPtr<EventTargetData> > EventTargetDataMap;
|
|
|
| static EventTargetDataMap& eventTargetDataMap()
|
| {
|
| +#if ENABLE(OILPAN)
|
| + DEFINE_STATIC_LOCAL(Persistent<EventTargetDataMap>, map, (new EventTargetDataMap()));
|
| + return *map;
|
| +#else
|
| DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ());
|
| return map;
|
| +#endif
|
| }
|
|
|
| EventTargetData* Node::eventTargetData()
|
| @@ -2334,6 +2343,12 @@ bool Node::willRespondToTouchEvents()
|
| }
|
|
|
| // This is here for inlining
|
| +#if ENABLE(OILPAN)
|
| +inline void TreeScope::removedLastRefToScope()
|
| +{
|
| + dispose();
|
| +}
|
| +#else
|
| inline void TreeScope::removedLastRefToScope()
|
| {
|
| ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun());
|
| @@ -2353,14 +2368,13 @@ inline void TreeScope::removedLastRefToScope()
|
| #if !ASSERT_DISABLED
|
| rootNode().m_inRemovedLastRefFunction = false;
|
| #endif
|
| -#if !ENABLE(OILPAN)
|
| #if SECURITY_ASSERT_ENABLED
|
| beginDeletion();
|
| #endif
|
| delete this;
|
| -#endif
|
| }
|
| }
|
| +#endif
|
|
|
| // It's important not to inline removedLastRef, because we don't want to inline the code to
|
| // delete a Node at each deref call site.
|
| @@ -2522,6 +2536,11 @@ void Node::setCustomElementState(CustomElementState newState)
|
| setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed
|
| }
|
|
|
| +void Node::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_treeScope);
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|
| #ifndef NDEBUG
|
|
|