LibWebView: Create a spare WebContent process

Since cross-site navigation is a pretty frequent task, creating a spare
process is commonplace in other browsers to reduce the overhead of
directing the target site to a new process.

We store this process on the WebView application. If it is unavailable,
we queue a task to create it later.
This commit is contained in:
Timothy Flynn 2025-03-09 18:01:25 -04:00 committed by Jelle Raaijmakers
parent 5810c8073e
commit aca4385daf
Notes: github-actions[bot] 2025-03-11 11:11:42 +00:00
8 changed files with 98 additions and 9 deletions

View file

@ -568,11 +568,8 @@ void ViewImplementation::initialize_client(CreateNewClient create_new_client)
if (create_new_client == CreateNewClient::Yes) {
m_client_state = {};
// FIXME: Fail to open the tab, rather than crashing the whole application if these fail.
auto request_server_socket = connect_new_request_server_client().release_value_but_fixme_should_propagate_errors();
auto image_decoder_socket = connect_new_image_decoder_client().release_value_but_fixme_should_propagate_errors();
m_client_state.client = launch_web_content_process(*this, AK::move(image_decoder_socket), AK::move(request_server_socket)).release_value_but_fixme_should_propagate_errors();
// FIXME: Fail to open the tab, rather than crashing the whole application if this fails.
m_client_state.client = Application::the().launch_web_content_process(*this).release_value_but_fixme_should_propagate_errors();
} else {
m_client_state.client->register_view(m_client_state.page_index, *this);
}