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

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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index b76f4bdb53a20e279534b84e89d090856ad71e8a..02c97b1b0ceded3667887dbee82afb29a004c099 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2254,6 +2254,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();
}
@@ -2285,7 +2287,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();
}
@@ -5629,12 +5631,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
@@ -5713,6 +5709,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);
@@ -5752,7 +5749,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);
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698