| Index: Source/core/dom/AXObjectCache.cpp
|
| diff --git a/Source/core/dom/AXObjectCache.cpp b/Source/core/dom/AXObjectCache.cpp
|
| index 97d0fd002093a027e51be606d4468c34c09ffe09..f44cdb18d990016e7f21c0ece1c1f2f5b7c8646a 100644
|
| --- a/Source/core/dom/AXObjectCache.cpp
|
| +++ b/Source/core/dom/AXObjectCache.cpp
|
| @@ -40,7 +40,7 @@ void AXObjectCache::init(AXObjectCacheCreateFunction function)
|
| m_createFunction = function;
|
| }
|
|
|
| -PassOwnPtr<AXObjectCache> AXObjectCache::create(Document& document)
|
| +PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCache::create(Document& document)
|
| {
|
| ASSERT(m_createFunction);
|
| return (m_createFunction)(document);
|
| @@ -54,14 +54,17 @@ AXObjectCache::~AXObjectCache()
|
| {
|
| }
|
|
|
| -PassOwnPtr<ScopedAXObjectCache> ScopedAXObjectCache::create(Document& document)
|
| +PassOwnPtrWillBeRawPtr<ScopedAXObjectCache> ScopedAXObjectCache::create(Document& document)
|
| {
|
| - return adoptPtr(new ScopedAXObjectCache(document));
|
| + return adoptPtrWillBeNoop(new ScopedAXObjectCache(document));
|
| }
|
|
|
| ScopedAXObjectCache::ScopedAXObjectCache(Document& document)
|
| : m_ownedCache(nullptr)
|
| , m_cache(nullptr)
|
| +#if ENABLE(ASSERT)
|
| + , m_hasBeenDisposed(false)
|
| +#endif
|
| {
|
| if (AXObjectCache* existingCache = document.axObjectCache()) {
|
| m_cache = existingCache;
|
| @@ -71,10 +74,30 @@ ScopedAXObjectCache::ScopedAXObjectCache(Document& document)
|
| }
|
| }
|
|
|
| +ScopedAXObjectCache::~ScopedAXObjectCache()
|
| +{
|
| + ASSERT(m_hasBeenDisposed);
|
| +}
|
| +
|
| +void ScopedAXObjectCache::dispose()
|
| +{
|
| + if (m_ownedCache)
|
| + m_ownedCache->dispose();
|
| +#if ENABLE(ASSERT)
|
| + m_hasBeenDisposed = true;
|
| +#endif
|
| +}
|
| +
|
| AXObjectCache* ScopedAXObjectCache::get()
|
| {
|
| ASSERT(m_cache);
|
| return m_cache;
|
| }
|
|
|
| +DEFINE_TRACE(ScopedAXObjectCache)
|
| +{
|
| + visitor->trace(m_ownedCache);
|
| + visitor->trace(m_cache);
|
| +}
|
| +
|
| } // namespace blink
|
|
|