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

Browser: Don't spawn RequestServer and WebSocket in multi-process mode

Single-process Browser forces a connection to these services early on,
to avoid having to unveil their paths. I'm suspicious of the benefits
of this (and the comment about it wasn't even accurate) but let's keep
it for now.

In multi-process mode, there's no need to do this, and in fact it was
causing us to spawn two extra totally unused processes.
This commit is contained in:
Andreas Kling 2021-05-14 17:09:11 +02:00
parent 3ed5a73ede
commit 5fd65adb19
2 changed files with 14 additions and 10 deletions

View file

@ -67,9 +67,11 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
// Connect to the RequestServer and the WebSocket service immediately so we can drop the "unix" pledge.
Web::ResourceLoader::the();
Web::HTML::WebSocketClientManager::the();
if (Browser::s_single_process) {
// Connect to the RequestServer and the WebSocket service immediately so we don't need to unveil their portals.
Web::ResourceLoader::the();
Web::HTML::WebSocketClientManager::the();
}
// Connect to LaunchServer immediately and let it know that we won't ask for anything other than opening
// the user's downloads directory.