Bug 1733109 - narrowing conversion from 'size_t' in MediaDecoder.cpp. r=bryce

INT64_MAX is more than enough for this, no worries to have.

Depends on D126932

Differential Revision: https://phabricator.services.mozilla.com/D126933
This commit is contained in:
Paul Adenot 2021-09-30 12:36:13 +00:00
Родитель 056fb0cac9
Коммит cfb400193d
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -1312,7 +1312,8 @@ MediaMemoryTracker::CollectReports(nsIHandleReportCallback* aHandleReport,
AbstractThread::MainThread(), __func__,
[handleReport, data](size_t size) {
handleReport->Callback(
""_ns, "explicit/media/resources"_ns, KIND_HEAP, UNITS_BYTES, size,
""_ns, "explicit/media/resources"_ns, KIND_HEAP, UNITS_BYTES,
static_cast<int64_t>(size),
nsLiteralCString("Memory used by media resources including "
"streaming buffers, caches, etc."),
data);
@ -1331,8 +1332,8 @@ MediaMemoryTracker::CollectReports(nsIHandleReportCallback* aHandleReport,
DecodersArray& decoders = Decoders();
for (size_t i = 0; i < decoders.Length(); ++i) {
MediaDecoder* decoder = decoders[i];
video += decoder->SizeOfVideoQueue();
audio += decoder->SizeOfAudioQueue();
video += static_cast<int64_t>(decoder->SizeOfVideoQueue());
audio += static_cast<int64_t>(decoder->SizeOfAudioQueue());
decoder->AddSizeOfResources(resourceSizes);
}