Bug 1571530 - Move Loader::Sheets out of line. r=heycam

I'm going to tweak it a bit.

Differential Revision: https://phabricator.services.mozilla.com/D40687

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-08-13 05:08:50 +00:00
parent c3ee3ac3a8
commit 8abfa9f557
2 changed files with 11 additions and 10 deletions

View File

@ -352,6 +352,16 @@ bool LoaderReusableStyleSheets::FindReusableStyleSheet(
return false;
}
// A struct keeping alive various records of sheets that are loading, deferred,
// or already loaded (the later one for caching purposes).
struct Loader::Sheets {
nsBaseHashtable<SheetLoadDataHashKey, RefPtr<StyleSheet>, StyleSheet*>
mCompleteSheets;
// The SheetLoadData pointers below are weak references.
nsDataHashtable<SheetLoadDataHashKey, SheetLoadData*> mLoadingDatas;
nsDataHashtable<SheetLoadDataHashKey, SheetLoadData*> mPendingDatas;
};
/*************************
* Loader Implementation *
*************************/

View File

@ -517,16 +517,7 @@ class Loader final {
// directly or indirectly @importing the sheet this SheetLoadData represents.
void MarkLoadTreeFailed(SheetLoadData* aLoadData);
struct Sheets {
nsBaseHashtable<SheetLoadDataHashKey, RefPtr<StyleSheet>, StyleSheet*>
mCompleteSheets;
nsDataHashtable<SheetLoadDataHashKey,
SheetLoadData*>
mLoadingDatas; // weak refs
nsDataHashtable<SheetLoadDataHashKey,
SheetLoadData*>
mPendingDatas; // weak refs
};
struct Sheets;
UniquePtr<Sheets> mSheets;
// The array of posted stylesheet loaded events (SheetLoadDatas) we have.