[network] cache memory reporter cleanup

This commit is contained in:
Moonchild 2022-02-11 13:20:09 +00:00 committed by roytam1
commit 232f5a4705
2 changed files with 5 additions and 4 deletions

View file

@ -3649,7 +3649,7 @@ CacheIndex::SizeOfExcludingThisInternal(mozilla::MallocSizeOf mallocSizeOf) cons
size_t
CacheIndex::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf)
{
sLock.AssertCurrentThreadOwns();
StaticMutexAutoLock lock(sLock);
if (!gInstance)
return 0;
@ -3663,7 +3663,8 @@ CacheIndex::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
{
StaticMutexAutoLock lock(sLock);
return mallocSizeOf(gInstance) + SizeOfExcludingThis(mallocSizeOf);
return mallocSizeOf(gInstance) +
(gInstance ? gInstance->SizeOfExcludingThisInternal(mallocSizeOf) : 0);
}
// static