зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1636266 - Report XUL Cache StyleSheet Memory r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D74450
This commit is contained in:
Родитель
5fff0f03db
Коммит
6b2aad6d2b
|
@ -504,7 +504,13 @@ void nsXULPrototypeCache::CollectMemoryReports(
|
|||
// TODO Report content in mPrototypeTable?
|
||||
|
||||
other += sInstance->mStyleSheetTable.ShallowSizeOfExcludingThis(mallocSizeOf);
|
||||
// TODO Report content inside mStyleSheetTable?
|
||||
for (auto iter = sInstance->mStyleSheetTable.ConstIter(); !iter.Done();
|
||||
iter.Next()) {
|
||||
// NOTE: If Loader::DoSheetComplete() is ever modified to stop clongin
|
||||
// sheets before inserting into this cache, we will need to stop using
|
||||
// SizeOfIncludingThis()
|
||||
other += iter.Data()->SizeOfIncludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
other += sInstance->mScriptTable.ShallowSizeOfExcludingThis(mallocSizeOf);
|
||||
// TODO Report content inside mScriptTable?
|
||||
|
|
|
@ -1856,6 +1856,10 @@ void Loader::DoSheetComplete(SheetLoadData& aLoadData,
|
|||
// We need to clone the sheet on insertion to the cache because
|
||||
// if the original sheet has a cyclic reference this can cause
|
||||
// leaks until shutdown since the global cache is not cycle-collected
|
||||
|
||||
// NOTE: If we stop cloning sheets before insertion, we need to change
|
||||
// nsXULPrototypeCache::CollectMemoryReports() to stop using
|
||||
// SizeOfIncludingThis() because it will no longer own the sheets.
|
||||
cache->PutStyleSheet(CloneSheet(*sheet));
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче