LRU algorithm adapts to usage table capacity.
[ Merge of http://go/wvgerrit/93564 ] OEMCrypto v16 introduced the ability to report the maximum possible size of the usage table to the CDM. The LRU algorithm will take the table capacity into account when deciding which entry is removed. Bug: 148795097 Bug: 135298906 Test: CDM unit tests Change-Id: Ibba88813618c13a9bf1121e560b8cc02b1c7e7a6
This commit is contained in:
@@ -88,6 +88,8 @@ class UsageTableHeader {
|
||||
|
||||
size_t size() { return usage_entry_info_.size(); }
|
||||
|
||||
size_t potential_table_capacity() const { return potential_table_capacity_; }
|
||||
|
||||
const std::vector<CdmUsageEntryInfo>& usage_entry_info() const {
|
||||
return usage_entry_info_;
|
||||
}
|
||||
@@ -209,6 +211,12 @@ class UsageTableHeader {
|
||||
// |clock_| variable, however, it can be overrided for testing purpose.
|
||||
Clock* clock_ref_;
|
||||
|
||||
// The maximum number of entries that the underlying OEMCrypto
|
||||
// implementation can support. Some implementations might not
|
||||
// support reporting the table capacity, if so, then this value is
|
||||
// assumed to be |kMinimumUsageTableEntriesSupported|.
|
||||
size_t potential_table_capacity_ = 0u;
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
// Test related declarations
|
||||
friend class UsageTableHeaderTest;
|
||||
|
||||
Reference in New Issue
Block a user