зеркало из https://github.com/mozilla/gecko-dev.git
Changing usage of nsCOMPtr on a non-interface pointer to raw addref-release. r=fur
This commit is contained in:
Родитель
d7bec0c5bc
Коммит
f63f0d0e73
|
@ -71,6 +71,8 @@ nsDiskCacheRecord::nsDiskCacheRecord(nsIDBAccessor* db, nsNetDiskCache* aCache)
|
|||
{
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
NS_ASSERTION(mDiskCache, "Must have an nsNetDiskCache");
|
||||
NS_ADDREF(mDiskCache);
|
||||
}
|
||||
|
||||
// mem alloced. so caller should do free() on key.
|
||||
|
@ -124,6 +126,7 @@ nsDiskCacheRecord::~nsDiskCacheRecord()
|
|||
if(mMetaData)
|
||||
nsAllocator::Free(mMetaData) ;
|
||||
|
||||
NS_IF_RELEASE(mDiskCache);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -60,7 +60,7 @@ class nsDiskCacheRecord : public nsINetDataCacheRecord
|
|||
void* mInfo ;
|
||||
PRUint32 mInfoSize ;
|
||||
PRUint32 mNumChannels ;
|
||||
nsCOMPtr<nsNetDiskCache> mDiskCache ;
|
||||
nsNetDiskCache* mDiskCache ;
|
||||
|
||||
friend class nsDiskCacheRecordChannel ;
|
||||
friend class nsDBEnumerator ;
|
||||
|
|
|
@ -104,12 +104,14 @@ nsDiskCacheRecordChannel::nsDiskCacheRecordChannel(nsDiskCacheRecord *aRecord,
|
|||
mLoadGroup(aLoadGroup)
|
||||
{
|
||||
NS_INIT_REFCNT() ;
|
||||
NS_ADDREF(mRecord);
|
||||
mRecord->mNumChannels++ ;
|
||||
}
|
||||
|
||||
nsDiskCacheRecordChannel::~nsDiskCacheRecordChannel()
|
||||
{
|
||||
mRecord->mNumChannels-- ;
|
||||
NS_RELEASE(mRecord);
|
||||
}
|
||||
|
||||
// FUR!!
|
||||
|
|
|
@ -53,7 +53,7 @@ class nsDiskCacheRecordChannel : public nsIChannel
|
|||
|
||||
nsresult NotifyStorageInUse(PRInt32 aBytesUsed) ;
|
||||
|
||||
nsCOMPtr<nsDiskCacheRecord> mRecord ;
|
||||
nsDiskCacheRecord* mRecord ;
|
||||
nsCOMPtr<nsILoadGroup> mLoadGroup ;
|
||||
nsCOMPtr<nsISupports> mOwner ;
|
||||
nsCOMPtr<nsIChannel> mFileTransport ;
|
||||
|
|
Загрузка…
Ссылка в новой задаче