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
This commit is contained in:
Rahul Frias
2019-03-08 14:00:01 -08:00
parent 502138ad84
commit d8afbb3b51

View File

@@ -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);