Backed out changeset 1cd15c87f867 (bug 821901) for crashes.

This commit is contained in:
Ryan VanderMeulen 2012-12-17 19:22:09 -05:00
parent f91af4d7f2
commit a5046a44ed

View File

@ -880,7 +880,7 @@ bool
nsNavHistoryContainerResultNode::DoesChildNeedResorting(uint32_t aIndex,
SortComparator aComparator, const char* aData)
{
NS_ASSERTION(aIndex < uint32_t(mChildren.Count()),
NS_ASSERTION(aIndex >= 0 && aIndex < uint32_t(mChildren.Count()),
"Input index out of range");
if (mChildren.Count() == 1)
return false;
@ -1626,9 +1626,8 @@ nsNavHistoryContainerResultNode::RemoveChildAt(int32_t aIndex,
uint32_t oldAccessCount = 0;
if (!aIsTemporary) {
oldAccessCount = mAccessCount;
NS_ASSERTION(mAccessCount >= mChildren[aIndex]->mAccessCount,
"Invalid access count while updating!");
mAccessCount -= mChildren[aIndex]->mAccessCount;
NS_ASSERTION(mAccessCount >= 0, "Invalid access count while updating!");
}
// Remove it from our list and notify the result's observers.
@ -4025,7 +4024,8 @@ nsNavHistoryFolderResultNode::OnItemMoved(int64_t aItemId,
NS_NOTREACHED("Can't find folder that is moving!");
return NS_ERROR_FAILURE;
}
NS_ASSERTION(index < uint32_t(mChildren.Count()), "Invalid index!");
NS_ASSERTION(index >= 0 && index < uint32_t(mChildren.Count()),
"Invalid index!");
node->mBookmarkIndex = aNewIndex;
// adjust position