LibWeb+WebContent: Convert ImageCodecPlugin to use the promise-based API

This commit is contained in:
Andrew Kaster 2024-04-19 15:02:12 -06:00 committed by Andrew Kaster
commit 39dfb659cf
Notes: sideshowbarker 2024-07-17 08:59:18 +09:00
6 changed files with 60 additions and 27 deletions

View file

@ -9,6 +9,7 @@
#include <AK/RefPtr.h>
#include <AK/Vector.h>
#include <LibCore/Promise.h>
#include <LibGfx/Forward.h>
namespace Web::Platform {
@ -31,7 +32,8 @@ public:
virtual ~ImageCodecPlugin();
virtual Optional<DecodedImage> decode_image(ReadonlyBytes) = 0;
virtual NonnullRefPtr<Core::Promise<DecodedImage>> decode_image(ReadonlyBytes, Function<ErrorOr<void>(DecodedImage&)> on_resolved, Function<void(Error&)> on_rejected) = 0;
Optional<DecodedImage> decode_image(ReadonlyBytes);
};
}