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
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

@ -16,6 +16,7 @@
#include <LibWeb/HTML/SelectItem.h>
#include <LibWeb/HTML/WebViewHints.h>
#include <LibWeb/Page/EventResult.h>
#include <LibWebView/Forward.h>
#include <WebContent/WebContentClientEndpoint.h>
#include <WebContent/WebContentServerEndpoint.h>
@ -38,14 +39,17 @@ public:
static size_t client_count() { return s_clients.size(); }
explicit WebContentClient(IPC::Transport);
WebContentClient(IPC::Transport, ViewImplementation&);
~WebContentClient();
void assign_view(Badge<Application>, ViewImplementation&);
void register_view(u64 page_id, ViewImplementation&);
void unregister_view(u64 page_id);
Function<void()> on_web_content_process_crash;
pid_t pid() const { return m_process_handle.pid; }
void set_pid(pid_t pid) { m_process_handle.pid = pid; }
private: