mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
Bug 384732 - Download manager should use a transaction when importing from downloads.rdf. Patch by Edward Lee <edilee@gmail.com>. r=sdwilsh
This commit is contained in:
parent
238b7dc549
commit
c756a733d7
@ -64,6 +64,7 @@
|
||||
#include "mozStorageCID.h"
|
||||
#include "mozIStorageService.h"
|
||||
#include "mozIStorageStatement.h"
|
||||
#include "mozStorageHelper.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsIAlertsService.h"
|
||||
|
||||
@ -258,6 +259,8 @@ nsDownloadManager::ImportDownloadHistory()
|
||||
getter_AddRefs(NC_DownloadState));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mozStorageTransaction transaction(mDBConn, PR_TRUE);
|
||||
|
||||
// OK, now we can actually start to read and process our data
|
||||
nsCOMPtr<nsIRDFContainer> container =
|
||||
do_CreateInstance(NS_RDF_CONTRACTID "/container;1", &rv);
|
||||
@ -329,8 +332,8 @@ nsDownloadManager::ImportDownloadHistory()
|
||||
rv = rdfInt->GetValue(&state);
|
||||
if (NS_FAILED(rv)) continue;
|
||||
|
||||
AddDownloadToDB(name, source, target, EmptyString(), startTime,
|
||||
endTime, state);
|
||||
(void)AddDownloadToDB(name, source, target, EmptyString(), startTime,
|
||||
endTime, state);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user