зеркало из https://github.com/mozilla/gecko-dev.git
Bug 815639 - mLocalFile in nsDiskCacheStream doesn't have to be in the class
This commit is contained in:
Родитель
277a560f9c
Коммит
c138c1ea53
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче