headless-browser: Handle WebContent crashes similar to the graphical UIs

Instead of bringing the whole browser down, let's re-initialize the
WebContent client so we can move on. This is particularly needed for
WPT.
This commit is contained in:
Timothy Flynn 2024-11-12 08:50:54 -05:00 committed by Tim Ledbetter
commit 70ce8046c3
Notes: github-actions[bot] 2024-11-12 14:27:00 +00:00
4 changed files with 42 additions and 12 deletions

View file

@ -168,9 +168,12 @@ void HeadlessWebView::initialize_client(CreateNewClient create_new_client)
client().async_connect_to_webdriver(m_client_state.page_index, *web_driver_ipc_path);
m_client_state.client->on_web_content_process_crash = [this] {
warnln("\033[31;1mWebContent Crashed!!\033[0m");
warnln(" Last page loaded: {}", url());
VERIFY_NOT_REACHED();
Core::deferred_invoke([this] {
handle_web_content_process_crash(LoadErrorPage::No);
if (on_web_content_crashed)
on_web_content_crashed();
});
};
}