mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 17:20:54 +00:00
Bug 924348 - Intermittent PROCESS-CRASH | /tests/dom/indexedDB/test/test_add_put.html | application crashed [@ sqlite3LeaveMutexAndCloseZombie] or [@ hashDestroy]. r=khuey
CLOSED TREE
This commit is contained in:
parent
794c7b3270
commit
5c6d029281
@ -1341,9 +1341,7 @@ QuotaManager::GetQuotaObject(PersistenceType aPersistenceType,
|
||||
fileSize = 0;
|
||||
}
|
||||
|
||||
// We need this extra raw pointer because we can't assign to the smart
|
||||
// pointer directly since QuotaObject::AddRef needs to acquire the same mutex.
|
||||
QuotaObject* quotaObject;
|
||||
nsRefPtr<QuotaObject> result;
|
||||
{
|
||||
MutexAutoLock lock(mQuotaMutex);
|
||||
|
||||
@ -1364,16 +1362,26 @@ QuotaManager::GetQuotaObject(PersistenceType aPersistenceType,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// We need this extra raw pointer because we can't assign to the smart
|
||||
// pointer directly since QuotaObject::AddRef would try to acquire the same
|
||||
// mutex.
|
||||
QuotaObject* quotaObject;
|
||||
if (!originInfo->mQuotaObjects.Get(path, "aObject)) {
|
||||
// Create a new QuotaObject.
|
||||
quotaObject = new QuotaObject(originInfo, path, fileSize);
|
||||
|
||||
// Put it to the hashtable. The hashtable is not responsible to delete
|
||||
// the QuotaObject.
|
||||
originInfo->mQuotaObjects.Put(path, quotaObject);
|
||||
// The hashtable is not responsible to delete the QuotaObject.
|
||||
}
|
||||
|
||||
// Addref the QuotaObject and move the ownership to the result. This must
|
||||
// happen before we unlock!
|
||||
result = quotaObject->LockedAddRef();
|
||||
}
|
||||
|
||||
// The caller becomes the owner of the QuotaObject, that is, the caller is
|
||||
// is responsible to delete it when the last reference is removed.
|
||||
nsRefPtr<QuotaObject> result = quotaObject;
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,17 @@ private:
|
||||
MOZ_COUNT_DTOR(QuotaObject);
|
||||
}
|
||||
|
||||
already_AddRefed<QuotaObject>
|
||||
LockedAddRef()
|
||||
{
|
||||
AssertCurrentThreadOwnsQuotaMutex();
|
||||
|
||||
++mRefCnt;
|
||||
|
||||
nsRefPtr<QuotaObject> result = dont_AddRef(this);
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
mozilla::ThreadSafeAutoRefCnt mRefCnt;
|
||||
|
||||
OriginInfo* mOriginInfo;
|
||||
|
Loading…
x
Reference in New Issue
Block a user