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

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

Issue 1081673003: Oilpan: Prepare to move AXObjectCache to the heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 8b08209c7a4b277d0cd87c1c6dc832c2a0e58151..cd3e31f463d61f1efe924e794ef383cb9a8bf53d 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2199,6 +2199,8 @@ void Document::clearAXObjectCache()
ASSERT(&axObjectCacheOwner() == this);
// Clear the cache member variable before calling delete because attempts
// are made to access it during destruction.
+ if (m_axObjectCache)
+ m_axObjectCache->dispose();
m_axObjectCache.clear();
}
@@ -5544,12 +5546,6 @@ void Document::platformColorsChanged()
styleEngine().platformColorsChanged();
}
-void Document::clearWeakMembers(Visitor* visitor)
-{
- if (m_axObjectCache)
- m_axObjectCache->clearWeakMembers(visitor);
-}
-
v8::Local<v8::Object> Document::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext)
{
// It's possible that no one except for the new wrapper owns this object at
@@ -5628,6 +5624,7 @@ DEFINE_TRACE(Document)
visitor->trace(m_activeHoverElement);
visitor->trace(m_documentElement);
visitor->trace(m_titleElement);
+ visitor->trace(m_axObjectCache);
visitor->trace(m_markers);
visitor->trace(m_cssTarget);
visitor->trace(m_currentScriptStack);
@@ -5667,7 +5664,6 @@ DEFINE_TRACE(Document)
visitor->trace(m_timeline);
visitor->trace(m_compositorPendingAnimations);
visitor->trace(m_contextDocument);
- visitor->template registerWeakMembers<Document, &Document::clearWeakMembers>(this);
WillBeHeapSupplementable<Document>::trace(visitor);
#endif
TreeScope::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698