зеркало из https://github.com/mozilla/pjs.git
Bug 416207 - Update cookie/permission services from changes to mozIStorageService::OpenDatabase. r=sdwilsh, sr=mconnor, a=beltzner
This commit is contained in:
Родитель
a7b3240475
Коммит
fe5c819390
|
@ -151,14 +151,22 @@ nsPermissionManager::InitDB()
|
|||
|
||||
// cache a connection to the hosts database
|
||||
rv = storage->OpenDatabase(permissionsFile, getter_AddRefs(mDBConn));
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool ready;
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready) {
|
||||
// delete and try again
|
||||
rv = permissionsFile->Remove(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = storage->OpenDatabase(permissionsFile, getter_AddRefs(mDBConn));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool tableExists = PR_FALSE;
|
||||
mDBConn->TableExists(NS_LITERAL_CSTRING("moz_hosts"), &tableExists);
|
||||
|
|
|
@ -467,13 +467,23 @@ nsCookieService::InitDB()
|
|||
|
||||
// cache a connection to the cookie database
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||
// delete and try again
|
||||
cookieFile->Remove(PR_FALSE);
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool ready;
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready) {
|
||||
// delete and try again
|
||||
rv = cookieFile->Remove(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = storage->OpenDatabase(cookieFile, getter_AddRefs(mDBConn));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mDBConn->GetConnectionReady(&ready);
|
||||
if (!ready)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
PRBool tableExists = PR_FALSE;
|
||||
mDBConn->TableExists(NS_LITERAL_CSTRING("moz_cookies"), &tableExists);
|
||||
if (!tableExists) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче