Bug 1291071 (Part 6) - Stop passing a decoder to FinalizeDecoder() and rename it NotifyDecodeComplete(). r=edwin

This commit is contained in:
Seth Fowler
2016-08-02 17:22:41 -07:00
parent 4f4921678b
commit c11b85f5a0
3 changed files with 36 additions and 27 deletions

View File

@@ -75,17 +75,16 @@ IDecodingTask::NotifyDecodeComplete(NotNull<RasterImage*> aImage,
// Synchronously notify if we can.
if (NS_IsMainThread() &&
!(aDecoder->GetDecoderFlags() & DecoderFlags::ASYNC_NOTIFY)) {
aImage->FinalizeDecoder(aDecoder, finalStatus, metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
aImage->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
return;
}
// We're forced to notify asynchronously.
NotNull<RefPtr<RasterImage>> image = aImage;
NotNull<RefPtr<Decoder>> decoder = aDecoder;
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
image->FinalizeDecoder(decoder.get(), finalStatus, metadata, telemetry,
progress, invalidRect, frameCount, surfaceFlags);
image->NotifyDecodeComplete(finalStatus, metadata, telemetry, progress,
invalidRect, frameCount, surfaceFlags);
}));
}