Bug 815639 - mLocalFile in nsDiskCacheStream doesn't have to be in the class

This commit is contained in:
Alfred Kayser 2012-12-21 15:25:50 +01:00
Родитель 277a560f9c
Коммит c138c1ea53
2 изменённых файлов: 3 добавлений и 7 удалений

9
netwerk/cache/nsDiskCacheStreams.cpp поставляемый
Просмотреть файл

@ -678,18 +678,16 @@ nsDiskCacheStreamIO::OpenCacheFile(int flags, PRFileDesc ** fd)
nsresult rv; nsresult rv;
nsDiskCacheMap * cacheMap = mDevice->CacheMap(); nsDiskCacheMap * cacheMap = mDevice->CacheMap();
nsCOMPtr<nsIFile> localFile;
rv = cacheMap->GetLocalFileForDiskCacheRecord(&mBinding->mRecord, rv = cacheMap->GetLocalFileForDiskCacheRecord(&mBinding->mRecord,
nsDiskCache::kData, nsDiskCache::kData,
!!(flags & PR_CREATE_FILE), !!(flags & PR_CREATE_FILE),
getter_AddRefs(mLocalFile)); getter_AddRefs(localFile));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
// create PRFileDesc for input stream - the 00600 is just for consistency // create PRFileDesc for input stream - the 00600 is just for consistency
rv = mLocalFile->OpenNSPRFileDesc(flags, 00600, fd); return localFile->OpenNSPRFileDesc(flags, 00600, fd);
if (NS_FAILED(rv)) return rv; // unable to open file
return NS_OK;
} }
@ -784,7 +782,6 @@ nsDiskCacheStreamIO::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
{ {
size_t usage = aMallocSizeOf(this); size_t usage = aMallocSizeOf(this);
usage += aMallocSizeOf(mLocalFile);
usage += aMallocSizeOf(mFD); usage += aMallocSizeOf(mFD);
usage += aMallocSizeOf(mBuffer); usage += aMallocSizeOf(mBuffer);

1
netwerk/cache/nsDiskCacheStreams.h поставляемый
Просмотреть файл

@ -70,7 +70,6 @@ private:
nsDiskCacheDevice * mDevice; nsDiskCacheDevice * mDevice;
nsDiskCacheOutputStream * mOutStream; // not an owning reference nsDiskCacheOutputStream * mOutStream; // not an owning reference
int32_t mInStreamCount; int32_t mInStreamCount;
nsCOMPtr<nsIFile> mLocalFile;
PRFileDesc * mFD; PRFileDesc * mFD;
uint32_t mStreamPos; // for Output Streams uint32_t mStreamPos; // for Output Streams