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

Unified Diff: media/base/android/media_statistics.cc

Issue 1458783002: Fix UMA metrics for MediaSourcePlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed bug when current time is unknown Created 5 years, 1 month 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 | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_statistics.cc
diff --git a/media/base/android/media_statistics.cc b/media/base/android/media_statistics.cc
index 19c0298e6ce0e7aa0ddac068410dca684edb8812..d3d36bb4ebed42ddd97d940135672f7b2f43b340 100644
--- a/media/base/android/media_statistics.cc
+++ b/media/base/android/media_statistics.cc
@@ -53,6 +53,12 @@ void MediaStatistics::StopAndReport(base::TimeDelta current_playback_time) {
if (start_time_ == kNoTimestamp())
return; // skip if there was no prior Start().
+ if (current_playback_time == kNoTimestamp()) {
+ // Cancel the start event and skip if current time is unknown.
+ start_time_ = kNoTimestamp();
+ return;
+ }
+
base::TimeDelta duration = current_playback_time - start_time_;
// Reset start time.
« no previous file with comments | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698