mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibWeb+LibImageDecoderClient: Reuse ImageDecoder service process
The overhead from spawning a new ImageDecoder for every decoding job is way too large and causing other problems as well (#5421) Let's keep the same decoder open and reuse it as long as it's working.
This commit is contained in:
@@ -44,7 +44,7 @@ struct DecodedImage {
|
||||
Vector<Frame> frames;
|
||||
};
|
||||
|
||||
class Client
|
||||
class Client final
|
||||
: public IPC::ServerConnection<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>
|
||||
, public ImageDecoderClientEndpoint {
|
||||
C_OBJECT(Client);
|
||||
@@ -54,9 +54,13 @@ public:
|
||||
|
||||
Optional<DecodedImage> decode_image(const ByteBuffer&);
|
||||
|
||||
Function<void()> on_death;
|
||||
|
||||
private:
|
||||
Client();
|
||||
|
||||
virtual void die() override;
|
||||
|
||||
virtual void handle(const Messages::ImageDecoderClient::Dummy&) override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user