Bug 426991 - Form submission extremely slow on large forms (with form Form history turned on). r=sdwilsh, r=gavin

This commit is contained in:
Justin Dolske 2008-10-10 14:51:49 -07:00
parent 63c721e654
commit 9b815f280a

View File

@ -227,8 +227,6 @@ nsFormHistory::AddEntry(const nsAString &aName, const nsAString &aValue)
if (!FormHistoryEnabled())
return NS_OK;
mozStorageTransaction transaction(mDBConn, PR_FALSE);
PRBool exists = PR_TRUE;
EntryExists(aName, aValue, &exists);
if (!exists) {
@ -242,7 +240,7 @@ nsFormHistory::AddEntry(const nsAString &aName, const nsAString &aValue)
rv = mDBInsertNameValue->Execute();
NS_ENSURE_SUCCESS(rv, rv);
}
return transaction.Commit();
return NS_OK;
}
NS_IMETHODIMP
@ -366,6 +364,10 @@ nsFormHistory::Notify(nsIDOMHTMLFormElement* formElt, nsIDOMWindowInternal* aWin
PRUint32 length;
elts->GetLength(&length);
if (length == 0)
return NS_OK;
mozStorageTransaction transaction(mDBConn, PR_FALSE);
for (PRUint32 i = 0; i < length; ++i) {
nsCOMPtr<nsIDOMNode> node;
elts->Item(i, getter_AddRefs(node));
@ -398,7 +400,7 @@ nsFormHistory::Notify(nsIDOMHTMLFormElement* formElt, nsIDOMWindowInternal* aWin
}
}
return NS_OK;
return transaction.Commit();
}
nsresult
nsFormHistory::OpenDatabase()