1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "CacheIndexContextIterator.h"
7 #include "CacheIndex.h"
14 CacheIndexContextIterator::CacheIndexContextIterator(CacheIndex
*aIndex
,
16 nsILoadContextInfo
*aInfo
)
17 : CacheIndexIterator(aIndex
, aAddNew
)
22 CacheIndexContextIterator::~CacheIndexContextIterator()
27 CacheIndexContextIterator::AddRecord(CacheIndexRecord
*aRecord
)
29 if (CacheIndexEntry::RecordMatchesLoadContextInfo(aRecord
, mInfo
)) {
30 CacheIndexIterator::AddRecord(aRecord
);
35 CacheIndexContextIterator::AddRecords(
36 const nsTArray
<CacheIndexRecord
*> &aRecords
)
38 // We need to add one by one so that those with wrong context are ignored.
39 for (uint32_t i
= 0; i
< aRecords
.Length(); ++i
) {
40 AddRecord(aRecords
[i
]);