mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 17:03:07 +09:00
Make resuming of decoding work for anonymous decoders.
This commit is contained in:
parent
072fbe1a93
commit
f84fdea422
3 changed files with 18 additions and 7 deletions
|
|
@ -142,8 +142,10 @@ MetadataDecodingTask::Run()
|
|||
// AnonymousDecodingTask implementation.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AnonymousDecodingTask::AnonymousDecodingTask(NotNull<Decoder*> aDecoder)
|
||||
AnonymousDecodingTask::AnonymousDecodingTask(NotNull<Decoder*> aDecoder,
|
||||
bool aResumable)
|
||||
: mDecoder(aDecoder)
|
||||
, mResumable(aResumable)
|
||||
{ }
|
||||
|
||||
void
|
||||
|
|
@ -168,5 +170,16 @@ AnonymousDecodingTask::Run()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AnonymousDecodingTask::Resume()
|
||||
{
|
||||
// Anonymous decoders normally get all their data at once. We have some situations
|
||||
// where they don't. If explicitly requested, resuming should be supported.
|
||||
if (mResumable) {
|
||||
RefPtr<AnonymousDecodingTask> self(this);
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction([self]() -> void { self->Run(); }));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace image
|
||||
} // namespace mozilla
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue