Consistent result variable in CdmSession::RestoreOfflineSession

(This is a merge of http://go/wvgerrit/139632.)

While fixing a compiler error about shadowed variables in CdmSession, I
noticed that this function had two result variables with different names
as well. This patch consolidates down to one result variable.

Bug: 207684988
Test: x86-64
Change-Id: Iaf6d742ef3409d85a1c364b486909d2497093112
This commit is contained in:
John "Juce" Bruce
2021-12-01 14:30:37 -08:00
parent c43b9fc3de
commit 8fd728e992

View File

@@ -249,9 +249,9 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id,
usage_entry_ = std::move(license_data.usage_entry);
usage_entry_number_ = license_data.usage_entry_number;
CdmResponseType status = LoadPrivateOrLegacyKey(
CdmResponseType result = LoadPrivateOrLegacyKey(
license_data.drm_certificate, license_data.wrapped_private_key);
if (status != NO_ERROR) return status;
if (result != NO_ERROR) return result;
// Attempts to restore a released offline license are treated as a release
// retry.
@@ -309,13 +309,11 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id,
std::string license_request_signature;
// Sign a fake message so that OEMCrypto will start the rental clock. The
// signature and generated core message are ignored.
const CdmResponseType status =
crypto_session_->PrepareAndSignLicenseRequest(
fake_message, &core_message, &license_request_signature);
if (status != NO_ERROR) return status;
result = crypto_session_->PrepareAndSignLicenseRequest(
fake_message, &core_message, &license_request_signature);
if (result != NO_ERROR) return result;
}
CdmResponseType result;
if (license_type == kLicenseTypeRelease) {
result = license_parser_->RestoreLicenseForRelease(
license_data.drm_certificate, key_request_, key_response_);