From d8afbb3b51aa3ad77a5111e177390697b5974555 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Fri, 8 Mar 2019 14:00:01 -0800 Subject: [PATCH] Add UsageTableHeader metrics [ Merge from http://go/wvgerrit/72183 ] Adds basic metrics for the usage table header. This adds the last rev of cdm_session.cpp that was merged to the wv repo. Bug: http://b/112919252 Test: Unit tests. Manual GPlay Change-Id: I9494caf6fcdfb3d335ea10fe8b712585e95c79e5 --- libwvdrmengine/cdm/core/src/cdm_session.cpp | 24 ++++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/cdm_session.cpp b/libwvdrmengine/cdm/core/src/cdm_session.cpp index f10e98b3..03afc3af 100644 --- a/libwvdrmengine/cdm/core/src/cdm_session.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_session.cpp @@ -299,10 +299,8 @@ CdmResponseType CdmSession::RestoreOfflineSession( if (usage_support_type_ == kUsageEntrySupport && !provider_session_token.empty() && usage_table_header_ != NULL) { - CdmResponseType sts = NO_ERROR; - M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(), - &usage_entry_), - crypto_metrics_, usage_table_header_update_entry_, sts); + CdmResponseType sts = + usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_); if (sts != NO_ERROR) { LOGE( "CdmSession::RestoreOfflineSession failed to update usage entry = " @@ -361,9 +359,8 @@ CdmResponseType CdmSession::RestoreUsageSession( if (usage_support_type_ == kUsageEntrySupport && usage_table_header_ != NULL) { - M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(), - &usage_entry_), - crypto_metrics_, usage_table_header_update_entry_, sts); + sts = + usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_); if (sts != NO_ERROR) { LOGE("CdmSession::RestoreUsageSession: failed to update usage entry: %d", sts); @@ -547,9 +544,7 @@ CdmResponseType CdmSession::AddKeyInternal(const CdmKeyResponse& key_response) { if (has_provider_session_token() && usage_support_type_ == kUsageEntrySupport && usage_table_header_ != NULL) { - M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(), - &usage_entry_), - crypto_metrics_, usage_table_header_update_entry_, sts); + usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_); } if (!is_offline_) @@ -724,9 +719,9 @@ CdmResponseType CdmSession::GenerateReleaseRequest(CdmKeyRequest* key_request) { if (has_provider_session_token() && usage_support_type_ == kUsageEntrySupport) { - M_TIME(status = usage_table_header_->UpdateEntry(crypto_session_.get(), - &usage_entry_), - crypto_metrics_, usage_table_header_update_entry_, status); + status = + usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_); + if (status != NO_ERROR) { LOGE( "CdmSession::GenerateReleaseRequest: Update usage entry failed = " @@ -1042,6 +1037,9 @@ CdmResponseType CdmSession::UpdateUsageEntryInformation() { } CdmResponseType sts = NO_ERROR; + // TODO(blueeyes): Add measurements to all UpdateEntry calls in a way that + // allos us to isolate this particular use case within + // UpdateUsageEntryInformation. M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_), crypto_metrics_, usage_table_header_update_entry_, sts);