Bug 1286444 - Fix types when using VideoPlaybackQuality values - r=kinetik

These numbers are only used to calculate a percentage, so they don't really
need to be 64-bit long.

MozReview-Commit-ID: FfdyStjGITL
This commit is contained in:
Gerald Squelart
2016-07-14 15:25:40 +10:00
parent 76e2ef3389
commit cbc62dde96

View File

@@ -3077,9 +3077,12 @@ HTMLMediaElement::ReportTelemetry()
if (HTMLVideoElement* vid = HTMLVideoElement::FromContentOrNull(this)) {
RefPtr<VideoPlaybackQuality> quality = vid->GetVideoPlaybackQuality();
uint64_t totalFrames = quality->TotalVideoFrames();
uint64_t droppedFrames = quality->DroppedVideoFrames();
uint32_t totalFrames = quality->TotalVideoFrames();
if (totalFrames) {
uint32_t droppedFrames = quality->DroppedVideoFrames();
MOZ_ASSERT(droppedFrames <= totalFrames);
// Dropped frames <= total frames, so 'percentage' cannot be higher than
// 100 and therefore can fit in a uint32_t (that Telemetry takes).
uint32_t percentage = 100 * droppedFrames / totalFrames;
LOG(LogLevel::Debug,
("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK"));