Core CDM: Removed secure stop support.

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

This CL removes support for secure stop / usage info sessions from the
CDM engine and CDM session.  APIs for related to secure stop
operations will return NOT_IMPLEMENTED_ERROR.

New secure stop licenses will be rejected by the CDM when added.

Bug: 242289743
Test: run_x86_64_tests request_license_test
Change-Id: I30cd47e580d63014e001c903382a28238746f6d4
This commit is contained in:
Alex Dale
2022-10-12 18:10:13 -07:00
parent f5fbfa6176
commit b039f31b27
6 changed files with 139 additions and 660 deletions

View File

@@ -75,12 +75,6 @@ class CdmSession {
virtual CdmResponseType RestoreOfflineSession(const CdmKeySetId& key_set_id,
CdmLicenseType license_type,
int* error_detail);
// Restores an usage session from the provided |usage_data|.
// The |error_detail| will be filled with an internal error code. The
// |error_detail| may be a CdmResponseType or other error code type. It is
// only suitable for additional logging or debugging.
virtual CdmResponseType RestoreUsageSession(
const DeviceFiles::CdmUsageData& usage_data, int* error_detail);
virtual const CdmSessionId& session_id() { return session_id_; }
virtual const CdmKeySetId& key_set_id() { return key_set_id_; }
@@ -150,7 +144,7 @@ class CdmSession {
virtual bool is_initial_usage_update() { return is_initial_usage_update_; }
virtual bool is_usage_update_needed() { return is_usage_update_needed_; }
virtual void reset_usage_flags() {
virtual void ResetUsageFlags() {
is_initial_usage_update_ = false;
is_usage_update_needed_ = false;
}
@@ -159,12 +153,19 @@ class CdmSession {
virtual bool is_offline() { return is_offline_; }
virtual bool is_temporary() { return is_temporary_; }
virtual bool license_received() { return license_received_; }
virtual bool has_provider_session_token() {
return (license_parser_ &&
license_parser_->provider_session_token().size() > 0);
virtual bool HasUsageEntry() {
// The PST is only set if a usage entry has been loaded.
return provider_session_token_.size() > 0;
}
virtual const std::string& provider_session_token() {
return provider_session_token_;
}
void SetProviderSessionTokenForTest(const std::string& pst) {
provider_session_token_ = pst;
}
virtual bool supports_usage_info() const {
virtual bool SupportsUsageEntries() const {
return usage_table_header_ != nullptr;
}
@@ -243,8 +244,6 @@ class CdmSession {
bool StoreLicense(CdmOfflineLicenseState state, int* error_detail);
bool UpdateUsageInfo();
CdmResponseType GenerateKeyRequestInternal(
const InitializationData& init_data, CdmLicenseType license_type,
const CdmAppParameterMap& app_parameters, CdmKeyRequest* key_request);
@@ -305,14 +304,15 @@ class CdmSession {
bool last_decrypt_failed_ = false;
// Usage related flags and data
bool is_initial_usage_update_;
bool is_usage_update_needed_;
bool is_initial_usage_update_ = true;
bool is_usage_update_needed_ = false;
// Only assign |usage_table_header_| if capable of supporting usage
// information.
UsageTableHeader* usage_table_header_ = nullptr;
uint32_t usage_entry_number_;
uint32_t usage_entry_number_ = 0;
CdmUsageEntry usage_entry_;
std::string usage_provider_session_token_;
// This PST should only be set if the session has a usage entry.
std::string provider_session_token_;
// information useful for offline and usage scenarios
CdmKeyMessage key_request_;