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

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, 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/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.cpp b/Source/modules/accessibility/AXObjectCacheImpl.cpp
index c7865471bdf926a65fff9e9bb2ca35dd76675bff..c45280df2ac8e647830d83d0eac959cff9d89a8d 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -85,20 +85,28 @@ namespace blink {
using namespace HTMLNames;
// static
-PassOwnPtr<AXObjectCache> AXObjectCacheImpl::create(Document& document)
+PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCacheImpl::create(Document& document)
{
- return adoptPtr(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();
@@ -107,6 +115,10 @@ AXObjectCacheImpl::~AXObjectCacheImpl()
obj->detach();
removeAXID(obj);
}
+
+#if ENABLE(ASSERT)
+ m_hasBeenDisposed = true;
+#endif
}
AXObject* AXObjectCacheImpl::root()
@@ -1347,4 +1359,10 @@ void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
obj->setElementRect(rect);
}
+DEFINE_TRACE(AXObjectCacheImpl)
+{
+ AXObjectCache::trace(visitor);
haraken 2015/05/29 09:16:19 Make this a tail call.
keishi 2015/06/08 06:27:52 Done.
+ visitor->template registerWeakMembers<AXObjectCacheImpl, &AXObjectCacheImpl::clearWeakMembers>(this);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698