Skip to content

Commit

Permalink
webview: add UMA for getDefaultVideoPoster.
Browse files Browse the repository at this point in the history
Add a boolean histogram to track how often apps actually override and
return a non-null value from getDefaultVideoPoster, to see if it's still
worth supporting this ancient feature.

Bug: 1174980
Change-Id: I1ad780297be2a5a308b58fa120af07e3f31ac1de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2706007
Commit-Queue: Richard Coles <[email protected]>
Reviewed-by: Mark Pearson <[email protected]>
Reviewed-by: Anna Malova <[email protected]>
Cr-Commit-Position: refs/heads/master@{#859159}
  • Loading branch information
tornewuff authored and Chromium LUCI CQ committed Mar 2, 2021
1 parent 3d0dd7d commit 0070b59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.TraceEvent;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.ScopedSysTraceEvent;
import org.chromium.base.task.PostTask;
import org.chromium.components.embedder_support.util.WebResourceResponseInfo;
Expand Down Expand Up @@ -1005,6 +1006,8 @@ public Bitmap getDefaultVideoPoster() {
if (TRACE) Log.i(TAG, "getDefaultVideoPoster");
result = mWebChromeClient.getDefaultVideoPoster();
}
RecordHistogram.recordBooleanHistogram(
"Android.WebView.CustomDefaultVideoPoster", result != null);
if (result == null) {
// The ic_play_circle_outline_black_48dp icon is transparent so we need to draw it
// on a gray background.
Expand Down
11 changes: 11 additions & 0 deletions tools/metrics/histograms/histograms_xml/android/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2441,6 +2441,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>

<histogram name="Android.WebView.CustomDefaultVideoPoster" enum="Boolean"
expires_after="2021-06-01">
<owner>[email protected]</owner>
<owner>src/android_webview/OWNERS</owner>
<summary>
Records true if the embedding app's implementation of the
WebChromeClient.getDefaultVideoPoster() callback returned a custom default
poster, or false if it did not.
</summary>
</histogram>

<histogram name="Android.WebView.DevUi.AppLaunch" enum="Boolean"
expires_after="2021-12-14">
<owner>[email protected]</owner>
Expand Down

0 comments on commit 0070b59

Please sign in to comment.