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

--HG--
extra : rebase_source : 704d7664a3462f68f2c495e3b5d66f71180d290b
This commit is contained in:
Gerald Squelart 2016-07-14 15:25:40 +10:00
parent 46e43139df
commit ddbe07d2c6

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"));