mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 416205 - Update nsDownloadManager::Init from changes to mozIStorageService::OpenDatabase. r=Mardak, a=schrep
This commit is contained in:
parent
edb598a960
commit
12b86dd2ef
@ -247,13 +247,22 @@ nsDownloadManager::InitDB(PRBool *aDoImport)
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = storage->OpenDatabase(dbFile, getter_AddRefs(mDBConn));
|
rv = storage->OpenDatabase(dbFile, getter_AddRefs(mDBConn));
|
||||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
// delete and try again
|
|
||||||
rv = dbFile->Remove(PR_TRUE);
|
PRBool ready;
|
||||||
|
(void)mDBConn->GetConnectionReady(&ready);
|
||||||
|
if (!ready) {
|
||||||
|
// delete and try again, since we don't care so much about losing a users
|
||||||
|
// download history
|
||||||
|
rv = dbFile->Remove(PR_FALSE);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
rv = storage->OpenDatabase(dbFile, getter_AddRefs(mDBConn));
|
rv = storage->OpenDatabase(dbFile, getter_AddRefs(mDBConn));
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
(void)mDBConn->GetConnectionReady(&ready);
|
||||||
|
if (!ready)
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
|
|
||||||
PRBool tableExists;
|
PRBool tableExists;
|
||||||
rv = mDBConn->TableExists(NS_LITERAL_CSTRING("moz_downloads"), &tableExists);
|
rv = mDBConn->TableExists(NS_LITERAL_CSTRING("moz_downloads"), &tableExists);
|
||||||
|
Loading…
Reference in New Issue
Block a user