Bug 1286444 - Use correct types to construct VideoPlaybackQuality - r=kinetik

VideoPlaybackQuality was fed uint64_t's, now it should be given uint32_t's.
Note that FrameStatistics currently provide uint32_t's, so we are fine now;
nevertheless I added a static_assert to verify that and ensure it stays true.

MozReview-Commit-ID: I0dgP1K4lg3

--HG--
extra : rebase_source : f8d673db0cd45d2b3ae03c092dff217e5d7ebbee
This commit is contained in:
Gerald Squelart 2016-07-14 15:18:36 +10:00
Родитель 46dec3c3f7
Коммит 46e43139df
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -229,9 +229,9 @@ already_AddRefed<VideoPlaybackQuality>
HTMLVideoElement::GetVideoPlaybackQuality()
{
DOMHighResTimeStamp creationTime = 0;
uint64_t totalFrames = 0;
uint64_t droppedFrames = 0;
uint64_t corruptedFrames = 0;
uint32_t totalFrames = 0;
uint32_t droppedFrames = 0;
uint32_t corruptedFrames = 0;
if (sVideoStatsEnabled) {
if (nsPIDOMWindowInner* window = OwnerDoc()->GetInnerWindow()) {
@ -243,6 +243,8 @@ HTMLVideoElement::GetVideoPlaybackQuality()
if (mDecoder) {
FrameStatistics& stats = mDecoder->GetFrameStatistics();
static_assert(sizeof(uint32_t) >= sizeof (stats.GetParsedFrames()),
"possible truncation from FrameStatistics to VideoPlaybackQuality");
totalFrames = stats.GetParsedFrames();
droppedFrames = stats.GetDroppedFrames();
corruptedFrames = 0;