mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 12:05:00 +00:00
LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now create them in the Browser chrome. Part 1/N of "all processes are owned by the chrome".
This commit is contained in:
parent
6ea4c248ab
commit
02edd240ae
26 changed files with 152 additions and 99 deletions
26
Userland/Libraries/LibWebView/SocketPair.cpp
Normal file
26
Userland/Libraries/LibWebView/SocketPair.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
#include <LibWebView/SocketPair.h>
|
||||
|
||||
template<>
|
||||
ErrorOr<void> IPC::encode(Encoder& encoder, WebView::SocketPair const& pair)
|
||||
{
|
||||
TRY(encoder.encode(pair.socket));
|
||||
TRY(encoder.encode(pair.fd_passing_socket));
|
||||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<WebView::SocketPair> IPC::decode(Decoder& decoder)
|
||||
{
|
||||
auto socket = TRY(decoder.decode<IPC::File>());
|
||||
auto fd_passing_socket = TRY(decoder.decode<IPC::File>());
|
||||
|
||||
return WebView::SocketPair { move(socket), move(fd_passing_socket) };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue