mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
4b5541e1b7
This is the same behavior as RequestServer, with the added benefit that we know how to gracefully reconnect ImageDecoder to all WebContent processes on restart.
28 lines
827 B
C++
28 lines
827 B
C++
/*
|
|
* Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibImageDecoderClient/Client.h>
|
|
#include <LibWeb/Platform/ImageCodecPlugin.h>
|
|
|
|
namespace Ladybird {
|
|
|
|
class ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin {
|
|
public:
|
|
explicit ImageCodecPlugin(NonnullRefPtr<ImageDecoderClient::Client>);
|
|
virtual ~ImageCodecPlugin() override;
|
|
|
|
virtual NonnullRefPtr<Core::Promise<Web::Platform::DecodedImage>> decode_image(ReadonlyBytes, Function<ErrorOr<void>(Web::Platform::DecodedImage&)> on_resolved, Function<void(Error&)> on_rejected) override;
|
|
|
|
void set_client(NonnullRefPtr<ImageDecoderClient::Client>);
|
|
|
|
private:
|
|
RefPtr<ImageDecoderClient::Client> m_client;
|
|
};
|
|
|
|
}
|