Bug 406422 - Globally decay adaptive input history to allow for new entries. r=dietrich

This commit is contained in:
Edward Lee 2008-07-16 13:45:42 -07:00
Родитель 14920a42e2
Коммит 5cb6496071
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -976,7 +976,7 @@ nsNavHistoryExpire::ExpireAnnotationsParanoid(mozIStorageConnection* aConnection
// nsNavHistoryExpire::ExpireInputHistoryParanoid
//
// Deletes dangling input history
// Deletes dangling input history, decay potentially unused entries
nsresult
nsNavHistoryExpire::ExpireInputHistoryParanoid(mozIStorageConnection* aConnection)
@ -989,6 +989,13 @@ nsNavHistoryExpire::ExpireInputHistoryParanoid(mozIStorageConnection* aConnectio
"WHERE h.id IS NULL)"));
NS_ENSURE_SUCCESS(rv, rv);
// Decay potentially unused entries (e.g. those that are at 1) to allow
// better chances for new entries that will start at 1
rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
"UPDATE moz_inputhistory "
"SET use_count = use_count * .9"));
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}