Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1890)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2770513003: Record the type of controls used for video persistence. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index b74c1712b8213aeee3b47506b7dedc20aa071ea5..8cb346f0b711cb3da6f8e2b0aa04650ca6c4944f 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -130,6 +130,7 @@ constexpr float kMostlyFillViewportThreshold = 0.85f;
constexpr double kMostlyFillViewportBecomeStableSeconds = 5;
constexpr double kCheckViewportIntersectionIntervalSeconds = 1;
+// This enum is used to record histograms. Do not reorder.
enum MediaControlsShow {
MediaControlsShowAttribute = 0,
MediaControlsShowFullscreen,
@@ -139,6 +140,13 @@ enum MediaControlsShow {
MediaControlsShowMax
};
+// This enum is used to record histograms. Do not reorder.
+enum VideoPersistenceControlsType {
+ VideoPersistenceControlsTypeNative = 0,
+ VideoPersistenceControlsTypeCustom,
+ VideoPersistenceControlsTypeCount
+};
+
String urlForLoggingMedia(const KURL& url) {
static const unsigned maximumURLLengthForLogging = 128;
@@ -3242,6 +3250,17 @@ void HTMLMediaElement::onBecamePersistentVideo(bool value) {
return;
if (value) {
+ // Record the type of video. If it is already fullscreen, it is a video with
+ // native controls, otherwise it is assumed to be with custom controls.
+ // This is only recorded when entering this mode.
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram,
+ ("Media.VideoPersistence.ControlsType",
+ VideoPersistenceControlsTypeCount));
+ if (isFullscreen())
+ histogram.count(VideoPersistenceControlsTypeNative);
+ else
+ histogram.count(VideoPersistenceControlsTypeCustom);
+
if (isFullscreen())
return;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698