1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 15:34:59 +00:00

Ladybird/Android: Create a service for ImageDecoder

This follows the pattern for the other services spawned by WebContent.
The notable quirk about this service is that it's actually spawned by
the ImageCodecPlugin rather than in main.cpp in the non-Android port.

As a result we needed to do some ifdef surgery to get all the pieces
in place. But we can now load images in the Android port again :^).
This commit is contained in:
Andrew Kaster 2023-10-31 15:27:23 -06:00 committed by Andrew Kaster
parent a54baa2c34
commit c990db0913
10 changed files with 108 additions and 8 deletions

View file

@ -17,6 +17,7 @@
#include <LibCore/LocalServer.h>
#include <LibCore/System.h>
#include <LibIPC/ConnectionFromClient.h>
#include <LibImageDecoderClient/Client.h>
#include <LibJS/Bytecode/Interpreter.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/HTML/Window.h>
@ -41,7 +42,11 @@ static ErrorOr<NonnullRefPtr<Protocol::WebSocketClient>> bind_web_socket_service
return bind_service<Protocol::WebSocketClient>(&bind_web_socket_java);
}
template ErrorOr<NonnullRefPtr<ImageDecoderClient::Client>, Error>
bind_service<ImageDecoderClient::Client>(void (*)(int, int));
static ErrorOr<void> load_content_filters();
static ErrorOr<void> load_autoplay_allowlist();
ErrorOr<int> service_main(int ipc_socket, int fd_passing_socket)