Chromium Code Reviews| 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 |