Core CDM: Remove secure stop from LRU algorithm.

[ Merge of http://go/wvgerrit/158877 ]

The UsageTableHeader's LRU algorithm for determining which entry to
evict when full uses special considerations based on the type of
entry (offline or secure stop).

This CL removes all secure-stop-specific considerations, and instead
treats secure stop's the same as an unused entry.  Secure stop entries
will always be selected for removal before offline licenses (expired
or not).

Additionally, LRU table upgrading will ignore secure-stop entries.
This has no effect in practice as DeviceFiles will not load secure
stop usage entries when UsageTableHeader is initialized on a real
file system.

Bug: 242289743
Test: run_x86_64_tests and request_license_test
Change-Id: Ib3f71f191aed94aad62951667426911e4e202068
This commit is contained in:
Alex Dale
2022-10-13 15:29:58 -07:00
parent da9ba6c3ba
commit 7a34c1748c
3 changed files with 202 additions and 427 deletions

View File

@@ -261,10 +261,9 @@ class UsageTableHeader {
int64_t GetCurrentTime() { return clock_ref_->GetCurrentTime(); }
// Sets LRU related metrics based on the provided |staleness| (in
// seconds) and |storage_type| of the entry removed.
// seconds).
void RecordLruEventMetrics(metrics::CryptoMetrics* metrics,
uint64_t staleness,
CdmUsageEntryStorageType storage_type);
uint64_t staleness);
// Uses an LRU-base algorithm to determine which license should be
// removed. This is intended to be used if the usage table is full