Commit 0eb1d376 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Report promise rejection system code UMA in CdmAdapter

Currently this UMA is reported in ContentDecryptorDelegate which is only
used in the pepper CDM path. This CL makes sure we report the same UMA
in the mojo CDM path as well.

TBR=bbudge@chromium.org
BUG=412987,721876
TEST=Manually tested and checked about://histograms

Change-Id: I4687e5115ee6d03e6a2701250bae50acf2dec2a8
Reviewed-on: https://chromium-review.googlesource.com/727700
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510246}
parent bb6bfc85
......@@ -385,8 +385,6 @@ CdmMessageType PpCdmMessageTypeToMediaMessageType(
}
}
// TODO(xhwang): Unify EME UMA reporting code when prefixed EME is deprecated.
// See http://crbug.com/412987 for details.
void ReportSystemCodeUMA(const std::string& key_system, uint32_t system_code) {
// Sparse histogram macro does not cache the histogram, so it's safe to use
// macro with non-static histogram name here.
......
......@@ -21,6 +21,7 @@
#include "media/base/channel_layout.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
#include "media/base/key_systems.h"
#include "media/base/limits.h"
#include "media/base/sample_format.h"
#include "media/base/video_codecs.h"
......@@ -377,6 +378,14 @@ void* GetCdmHost(int host_interface_version, void* user_data) {
}
}
void ReportSystemCodeUMA(const std::string& key_system, uint32_t system_code) {
// Sparse histogram macro does not cache the histogram, so it's safe to use
// macro with non-static histogram name here.
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Media.EME." + GetKeySystemNameForUMA(key_system) + ".SystemCode",
system_code);
}
} // namespace
// static
......@@ -811,6 +820,11 @@ void CdmAdapter::OnRejectPromise(uint32_t promise_id,
uint32_t system_code,
const char* error_message,
uint32_t error_message_size) {
// This is the central place for library CDM promise rejection. Cannot report
// this is more generic classes like CdmPromise or CdmPromiseAdapter because
// they may be used multiple times in one promise chain that involves IPC.
ReportSystemCodeUMA(key_system_, system_code);
DCHECK(task_runner_->BelongsToCurrentThread());
cdm_promise_adapter_.RejectPromise(
promise_id, ToMediaExceptionType(exception), system_code,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment