Bug 1584690 - append nonexistent hash to ContentBlockingLog; r=Ehsan

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Liang-Heng Chen 2019-10-04 22:23:20 +00:00
parent cd4002626d
commit c313d09fdf

View File

@ -110,12 +110,13 @@ class ContentBlockingLog final {
// We don't care about if the the reason is the same, just keep the
// first one.
// Note: {aReason, aTrackingFullHashes} are not compared here and we
// simply keep the first ones.
#ifdef DEBUG
// simply keep the first for the reason, and merge hashes to make sure
// they can be correctly recorded.
for (const auto& hash : aTrackingFullHashes) {
MOZ_ASSERT(last.mTrackingFullHashes.Contains(hash));
if (!last.mTrackingFullHashes.Contains(hash)) {
last.mTrackingFullHashes.AppendElement(hash);
}
}
#endif
return;
}
}