sunil mayya 342149fc2f Bug 1845848 - prevent disk cache entries eviction for private browsing mode. r=necko-reviewers,valentin
The assertion in the bug is because we were trying to evict disk cache entries in the context of private browsing mode.
Generally, for Private browsing mode we don't write use Disk Storage. During the [initialization](https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheStorageService.cpp#1557).  of storage entry, WriteToDisk[https://searchfox.org/mozilla-central/rev/5f0a7ca8968ac5cef8846e1d970ef178b8b76dcc/netwerk/cache2/CacheStorage.h#54] will be false due to private browsing mode. Due to this, we are sure that private browsing mode cache entries wont be written to disks.

The solution for the bug here is to prevent an attempt to evict the disk cache entries in private browsing mode, similar to the check in [DoomStorageEntries](https://searchfox.org/mozilla-central/source/netwerk/cache2/CacheStorageService.cpp#1929).

Differential Revision: https://phabricator.services.mozilla.com/D204810
2024-03-18 08:49:10 +00:00
..