| 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
|
|
|