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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2294333004: Include playbacks which never underflow in underflow metrics. (Closed)
Patch Set: Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index cde7e38e0a693f2e56086525005bb4e2d23efc8e..1fdcda87de2b80b4d16b869dc862b741da5c1dd5 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1084,6 +1084,15 @@ void WebMediaPlayerImpl::OnBufferingStateChange(BufferingState state) {
return;
if (state == BUFFERING_HAVE_ENOUGH) {
+ if (data_source_ &&
+ highest_ready_state_ < WebMediaPlayer::ReadyStateHaveEnoughData) {
+ DCHECK_EQ(underflow_count_, 0);
+ // Record a zero value for underflow histograms so that the histogram
+ // includes playbacks which never encounter an underflow event.
+ UMA_HISTOGRAM_COUNTS_100("Media.UnderflowCount", 0);
Steven Holte 2016/09/07 00:24:26 You should probably consolidate the macro calls fo
+ UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", base::TimeDelta());
+ }
+
// TODO(chcunningham): Monitor playback position vs buffered. Potentially
// transition to HAVE_FUTURE_DATA here if not enough is buffered.
SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698