diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-01-29 09:40:44 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-01-29 09:40:44 +0100 |
commit | 1a04d73a129926d54e13ac9d947062b221f0bacd (patch) | |
tree | f7bb70c9928ad16a56e2532f9d98aece61dbe1c4 /image/IDecodingTask.cpp | |
parent | 1f9ab3a6e6e3f1e79b482c0540c98859bbc71350 (diff) | |
parent | 7f992d50e417b0c2f18259ce2353e3ead4870694 (diff) | |
download | UXP-1a04d73a129926d54e13ac9d947062b221f0bacd.tar UXP-1a04d73a129926d54e13ac9d947062b221f0bacd.tar.gz UXP-1a04d73a129926d54e13ac9d947062b221f0bacd.tar.lz UXP-1a04d73a129926d54e13ac9d947062b221f0bacd.tar.xz UXP-1a04d73a129926d54e13ac9d947062b221f0bacd.zip |
Merge branch 'master' into cycle_collector-work
Diffstat (limited to 'image/IDecodingTask.cpp')
-rw-r--r-- | image/IDecodingTask.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/image/IDecodingTask.cpp b/image/IDecodingTask.cpp index a067e7a7d..6e2f039be 100644 --- a/image/IDecodingTask.cpp +++ b/image/IDecodingTask.cpp @@ -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 |