Bug 853562 - Fix nsTArray::SetCapacity callers in IndexedDB to not look at the return value; r=bent

This commit is contained in:
Ehsan Akhgari 2013-03-21 14:46:21 -04:00
parent 3a3f711de5
commit 1ce7621697

View File

@ -3936,14 +3936,11 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
bool hasResult;
while (NS_SUCCEEDED((rv = stmt->ExecuteStep(&hasResult))) && hasResult) {
if (mCloneReadInfos.Capacity() == mCloneReadInfos.Length()) {
if (!mCloneReadInfos.SetCapacity(mCloneReadInfos.Capacity() * 2)) {
NS_ERROR("Out of memory!");
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
mCloneReadInfos.SetCapacity(mCloneReadInfos.Capacity() * 2);
}
StructuredCloneReadInfo* readInfo = mCloneReadInfos.AppendElement();
NS_ASSERTION(readInfo, "Shouldn't fail if SetCapacity succeeded!");
NS_ASSERTION(readInfo, "Shouldn't fail since SetCapacity succeeded!");
rv = IDBObjectStore::GetStructuredCloneReadInfoFromStatement(stmt, 0, 1,
mDatabase, *readInfo);