Commit 8d2ff6d3 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Fix UMA reporting on EME new session failure

Currently in NewSessionCdmResultPromise::reject(), we missed the
|key_system_uma_prefix_| when reporting UMA. As a result, all failure
cases are reported to a wrong UMA name.

For the record, the bug was first introduced in:
https://codereview.chromium.org/2691673002/

This CL is manually tested as follows:
1. Update ClearKeyCdm::CreateSessionAndGenerateRequest() to
   unconditionally reject the promise with system code 111.
2. Build browser_test and run the following:
   out/Debug/browser_tests
   --gtest_filter=MSE_ExternalClearKey*Playback_VideoOnly_MP4_VP9/0
   -v=1
   where -v=1 will print out all histograms at the end.
3. Made sure we have the following:

   Histogram: Media.EME.Unknown.GenerateRequest recorded 1 samples,
   mean = 2.0 (flags = 0x41)
   0  ...
   2  ------------------------------------------O (1 = 100.0%) {0.0%}
   3  ...

   Histogram: Media.EME.Unknown.GenerateRequest.SystemCode recorded 1
   samples (flags = 0x41)
   111  -----------------------------------------------O (1 = 100.0%)

Bug: 690722
Test: See above
Change-Id: I81a81a7e8a0e650494209dc1c7dd0e6d950d8353
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747045
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686194}
parent 5f2f6a1d
......@@ -99,7 +99,7 @@ void NewSessionCdmResultPromise::reject(CdmPromise::Exception exception_code,
<< ", error_message = " << error_message;
MarkPromiseSettled();
ReportCdmResultUMA(uma_name_, system_code,
ReportCdmResultUMA(key_system_uma_prefix_ + uma_name_, system_code,
ConvertCdmExceptionToResultForUMA(exception_code));
web_cdm_result_.CompleteWithError(ConvertCdmException(exception_code),
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