Ladybird/Android: Make bind_service helper public in WebContentService

We'll need to call this from other Ladybird files for future services.
This commit is contained in:
Andrew Kaster 2023-10-31 15:24:50 -06:00 committed by Andrew Kaster
parent 5b03135c46
commit 4956514dfb
Notes: sideshowbarker 2024-07-17 23:07:41 +09:00
2 changed files with 6 additions and 4 deletions

View file

@ -31,9 +31,6 @@
#include <WebContent/ConnectionFromClient.h>
#include <WebContent/PageHost.h>
template<typename Client>
static ErrorOr<NonnullRefPtr<Client>> bind_service(void (*bind_method)(int, int));
static ErrorOr<NonnullRefPtr<Protocol::RequestClient>> bind_request_server_service()
{
return bind_service<Protocol::RequestClient>(&bind_request_server_java);
@ -92,7 +89,7 @@ ErrorOr<int> service_main(int ipc_socket, int fd_passing_socket)
}
template<typename Client>
static ErrorOr<NonnullRefPtr<Client>> bind_service(void (*bind_method)(int, int))
ErrorOr<NonnullRefPtr<Client>> bind_service(void (*bind_method)(int, int))
{
int socket_fds[2] {};
TRY(Core::System::socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fds));

View file

@ -6,5 +6,10 @@
#pragma once
#include <AK/NonnullRefPtr.h>
template<typename Client>
ErrorOr<NonnullRefPtr<Client>> bind_service(void (*bind_method)(int, int));
void bind_request_server_java(int ipc_socket, int fd_passing_socket);
void bind_web_socket_java(int ipc_socket, int fd_passing_socket);