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

Unified Diff: Source/modules/accessibility/AXObjectCacheImpl.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/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.cpp b/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 943224748760ba4e936d61945487c0460d59120c..3d99deaa1c0ac1b7bf134064612c15e4c814b402 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -84,20 +84,28 @@ namespace blink {
using namespace HTMLNames;
// static
-AXObjectCache* AXObjectCacheImpl::create(Document& document)
+PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCacheImpl::create(Document& document)
{
- return new AXObjectCacheImpl(document);
+ return adoptPtrWillBeNoop(new AXObjectCacheImpl(document));
}
AXObjectCacheImpl::AXObjectCacheImpl(Document& document)
: m_document(document)
, m_modificationCount(0)
+#if ENABLE(ASSERT)
+ , m_hasBeenDisposed(false)
+#endif
, m_notificationPostTimer(this, &AXObjectCacheImpl::notificationPostTimerFired)
{
}
AXObjectCacheImpl::~AXObjectCacheImpl()
{
+ ASSERT(m_hasBeenDisposed);
+}
+
+void AXObjectCacheImpl::dispose()
+{
m_notificationPostTimer.stop();
HashMap<AXID, RefPtr<AXObject>>::iterator end = m_objects.end();
@@ -106,6 +114,10 @@ AXObjectCacheImpl::~AXObjectCacheImpl()
obj->detach();
removeAXID(obj);
}
+
+#if ENABLE(ASSERT)
+ m_hasBeenDisposed = true;
+#endif
}
AXObject* AXObjectCacheImpl::root()
@@ -1354,4 +1366,10 @@ void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
obj->setElementRect(rect);
}
+DEFINE_TRACE(AXObjectCacheImpl)
+{
+ visitor->template registerWeakMembers<AXObjectCacheImpl, &AXObjectCacheImpl::clearWeakMembers>(this);
+ AXObjectCache::trace(visitor);
+}
+
} // namespace blink
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.h ('k') | Source/modules/accessibility/InspectorAccessibilityAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698