mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 15:24:57 +00:00
Ladybird: Add WebContentService for Android port
This will let us spawn a new process for an Android Service to handle all our WebContent needs. The ServiceConnection is manged by each WebView. The lifecycle of the Service is not quite clear yet, but each bindService call will get a unique Messenger that can be used to transfer the WebContent side of the LibIPC socketpair we use in other ports.
This commit is contained in:
parent
ffc0046d74
commit
6952de73dc
9 changed files with 334 additions and 40 deletions
17
Ladybird/Android/src/main/cpp/WebContentService.cpp
Normal file
17
Ladybird/Android/src/main/cpp/WebContentService.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_org_serenityos_ladybird_WebContentService_nativeHandleTransferSockets(JNIEnv*, jobject /* thiz */, jint ipc_socket, jint fd_passing_socket)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "WebContent", "New binding received, sockets %d and %d", ipc_socket, fd_passing_socket);
|
||||
::close(ipc_socket);
|
||||
::close(fd_passing_socket);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue