Bug 1291071 (Part 3) - Pass telemetry explicitly to FinalizeDecoder. r=edwin

This commit is contained in:
Seth Fowler
2016-08-02 16:34:23 -07:00
parent 3cae096c3c
commit 251ed225e5
5 changed files with 60 additions and 28 deletions

View File

@@ -65,6 +65,7 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Capture the decoder's state.
ImageMetadata metadata = aDecoder->GetImageMetadata();
DecoderTelemetry telemetry = aDecoder->Telemetry();
Progress progress = aDecoder->TakeProgress();
IntRect invalidRect = aDecoder->TakeInvalidRect();
Maybe<uint32_t> frameCount = aDecoder->TakeCompleteFrameCount();
@@ -73,8 +74,8 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Synchronously notify if we can.
if (NS_IsMainThread() &&
!(aDecoder->GetDecoderFlags() & DecoderFlags::ASYNC_NOTIFY)) {
aImage->FinalizeDecoder(aDecoder, metadata, progress, invalidRect,
frameCount, surfaceFlags);
aImage->FinalizeDecoder(aDecoder, metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
return;
}
@@ -82,8 +83,8 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
NotNull<RefPtr<RasterImage>> image = aImage;
NotNull<RefPtr<Decoder>> decoder = aDecoder;
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
image->FinalizeDecoder(decoder.get(), metadata, progress, invalidRect,
frameCount, surfaceFlags);
image->FinalizeDecoder(decoder.get(), metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
}));
}