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

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, 6 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 aa0d259600d14a7e74878ef5cfdde09cbb5f19a4..9b0511ddc6e663203c3e32580568af971fab7083 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2196,6 +2196,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();
}
@@ -2227,7 +2229,7 @@ AXObjectCache* Document::axObjectCache() const
ASSERT(&cacheOwner == this || !m_axObjectCache);
if (!cacheOwner.m_axObjectCache)
- cacheOwner.m_axObjectCache = adoptPtr(AXObjectCache::create(cacheOwner));
+ cacheOwner.m_axObjectCache = AXObjectCache::create(cacheOwner);
return cacheOwner.m_axObjectCache.get();
}
@@ -5541,12 +5543,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
@@ -5625,6 +5621,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);
@@ -5664,7 +5661,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