[network] Use a proof of lock everywhere in cache v2.

This commit is contained in:
Moonchild 2021-08-11 23:49:44 +00:00 committed by roytam1
commit 9aed4d8a38
6 changed files with 355 additions and 344 deletions

View file

@ -24,20 +24,11 @@ CacheIndexContextIterator::~CacheIndexContextIterator()
}
void
CacheIndexContextIterator::AddRecord(CacheIndexRecord *aRecord)
CacheIndexContextIterator::AddRecord(CacheIndexRecordWrapper* aRecord,
const StaticMutexAutoLock& aProofOfLock)
{
if (CacheIndexEntry::RecordMatchesLoadContextInfo(aRecord, mInfo)) {
CacheIndexIterator::AddRecord(aRecord);
}
}
void
CacheIndexContextIterator::AddRecords(
const nsTArray<CacheIndexRecord *> &aRecords)
{
// We need to add one by one so that those with wrong context are ignored.
for (uint32_t i = 0; i < aRecords.Length(); ++i) {
AddRecord(aRecords[i]);
CacheIndexIterator::AddRecord(aRecord, aProofOfLock);
}
}