1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

WebContent: Turn it into a MultiInstance service :^)

Port the WebContent service to the new MultiInstance mechanism that
Sergey added. This means that every new WebContentView gets its very
own segregated WebContent process.
This commit is contained in:
Andreas Kling 2020-06-21 21:22:10 +02:00
parent ed351c7493
commit 59537cf257
5 changed files with 10 additions and 17 deletions

View file

@ -49,18 +49,7 @@ int main(int, char**)
return 1;
}
auto server = Core::LocalServer::construct();
bool ok = server->take_over_from_system_server();
ASSERT(ok);
server->on_ready_to_accept = [&] {
auto client_socket = server->accept();
if (!client_socket) {
dbg() << "WebContent: accept failed.";
return;
}
static int s_next_client_id = 0;
int client_id = ++s_next_client_id;
IPC::new_client_connection<WebContent::ClientConnection>(*client_socket, client_id);
};
auto socket = Core::LocalSocket::take_over_accepted_socket_from_system_server();
IPC::new_client_connection<WebContent::ClientConnection>(*socket, 1);
return event_loop.exec();
}