зеркало из https://github.com/mozilla/pjs.git
37071 Crash while downloading anything
This commit is contained in:
Родитель
73b7310c91
Коммит
43963449c6
|
@ -472,7 +472,7 @@ nsNetDiskCache::GetCachedNetDataByID(PRInt32 RecordID, nsINetDataCacheRecord **_
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_ERROR("Error: RecordID not in DB\n");
|
||||
NS_WARNING("Error: RecordID not in DB\n");
|
||||
DBRecovery();
|
||||
return rv;
|
||||
}
|
||||
|
@ -751,18 +751,9 @@ nsNetDiskCache::DBRecovery(void)
|
|||
|
||||
|
||||
// False since we want to delete a file rather than recursively delete a directory
|
||||
mDBFile->Delete(PR_FALSE) ;
|
||||
rv = mDBFile->Delete(PR_FALSE) ;
|
||||
if (NS_FAILED ( rv ) ) return rv;
|
||||
|
||||
// make sure it's not there any more
|
||||
// DJM shouldn't we just check the return value?
|
||||
|
||||
PRBool exists =PR_FALSE;
|
||||
mDBFile->Exists( &exists );
|
||||
|
||||
if(exists) {
|
||||
NS_ERROR("can't remove old db.") ;
|
||||
return NS_ERROR_FAILURE ;
|
||||
}
|
||||
|
||||
// reinitilize DB
|
||||
return InitDB() ;
|
||||
|
|
|
@ -1029,8 +1029,9 @@ nsresult
|
|||
nsCachedNetData::Evict(PRUint32 aTruncatedContentLength)
|
||||
{
|
||||
nsCOMPtr<nsINetDataCacheRecord> record;
|
||||
GetRecord(getter_AddRefs(record));
|
||||
|
||||
nsresult rv = GetRecord(getter_AddRefs(record));
|
||||
if ( NS_FAILED( rv ) ) return rv;
|
||||
if ( record.get() == NULL ) return NS_ERROR_FAILURE;
|
||||
// Tell observers about the eviction, so that they can release their
|
||||
// references to this cache object.
|
||||
Notify(nsIStreamAsFileObserver::REQUEST_DELETION, NS_OK);
|
||||
|
|
Загрузка…
Ссылка в новой задаче