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:
@@ -299,10 +299,8 @@ CdmResponseType CdmSession::RestoreOfflineSession(
|
|||||||
|
|
||||||
if (usage_support_type_ == kUsageEntrySupport &&
|
if (usage_support_type_ == kUsageEntrySupport &&
|
||||||
!provider_session_token.empty() && usage_table_header_ != NULL) {
|
!provider_session_token.empty() && usage_table_header_ != NULL) {
|
||||||
CdmResponseType sts = NO_ERROR;
|
CdmResponseType sts =
|
||||||
M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(),
|
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||||
&usage_entry_),
|
|
||||||
crypto_metrics_, usage_table_header_update_entry_, sts);
|
|
||||||
if (sts != NO_ERROR) {
|
if (sts != NO_ERROR) {
|
||||||
LOGE(
|
LOGE(
|
||||||
"CdmSession::RestoreOfflineSession failed to update usage entry = "
|
"CdmSession::RestoreOfflineSession failed to update usage entry = "
|
||||||
@@ -361,9 +359,8 @@ CdmResponseType CdmSession::RestoreUsageSession(
|
|||||||
|
|
||||||
if (usage_support_type_ == kUsageEntrySupport &&
|
if (usage_support_type_ == kUsageEntrySupport &&
|
||||||
usage_table_header_ != NULL) {
|
usage_table_header_ != NULL) {
|
||||||
M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(),
|
sts =
|
||||||
&usage_entry_),
|
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||||
crypto_metrics_, usage_table_header_update_entry_, sts);
|
|
||||||
if (sts != NO_ERROR) {
|
if (sts != NO_ERROR) {
|
||||||
LOGE("CdmSession::RestoreUsageSession: failed to update usage entry: %d",
|
LOGE("CdmSession::RestoreUsageSession: failed to update usage entry: %d",
|
||||||
sts);
|
sts);
|
||||||
@@ -547,9 +544,7 @@ CdmResponseType CdmSession::AddKeyInternal(const CdmKeyResponse& key_response) {
|
|||||||
if (has_provider_session_token() &&
|
if (has_provider_session_token() &&
|
||||||
usage_support_type_ == kUsageEntrySupport &&
|
usage_support_type_ == kUsageEntrySupport &&
|
||||||
usage_table_header_ != NULL) {
|
usage_table_header_ != NULL) {
|
||||||
M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(),
|
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||||
&usage_entry_),
|
|
||||||
crypto_metrics_, usage_table_header_update_entry_, sts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_offline_)
|
if (!is_offline_)
|
||||||
@@ -724,9 +719,9 @@ CdmResponseType CdmSession::GenerateReleaseRequest(CdmKeyRequest* key_request) {
|
|||||||
|
|
||||||
if (has_provider_session_token() &&
|
if (has_provider_session_token() &&
|
||||||
usage_support_type_ == kUsageEntrySupport) {
|
usage_support_type_ == kUsageEntrySupport) {
|
||||||
M_TIME(status = usage_table_header_->UpdateEntry(crypto_session_.get(),
|
status =
|
||||||
&usage_entry_),
|
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||||
crypto_metrics_, usage_table_header_update_entry_, status);
|
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
LOGE(
|
LOGE(
|
||||||
"CdmSession::GenerateReleaseRequest: Update usage entry failed = "
|
"CdmSession::GenerateReleaseRequest: Update usage entry failed = "
|
||||||
@@ -1042,6 +1037,9 @@ CdmResponseType CdmSession::UpdateUsageEntryInformation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType sts = NO_ERROR;
|
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(),
|
M_TIME(sts = usage_table_header_->UpdateEntry(crypto_session_.get(),
|
||||||
&usage_entry_),
|
&usage_entry_),
|
||||||
crypto_metrics_, usage_table_header_update_entry_, sts);
|
crypto_metrics_, usage_table_header_update_entry_, sts);
|
||||||
|
|||||||
Reference in New Issue
Block a user