mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
WebContent: Add shutdown_server IPC call to request process exit
This ensures that removing the last view from a WebContentClient will close its associated process, assuming the WebContent process is not hung. A more drastic measure will be needed to trigger forcefully killing the process when it doesn't respond to this request.
This commit is contained in:
committed by
Alexander Kalenik
parent
4cc3d598f9
commit
29b4f21c7b
@@ -50,6 +50,7 @@ void WebContentClient::unregister_view(u64 page_id)
|
||||
m_views.remove(page_id);
|
||||
if (m_views.is_empty()) {
|
||||
on_web_content_process_crash = nullptr;
|
||||
async_close_server();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,11 @@ Optional<PageClient const&> ConnectionFromClient::page(u64 index, SourceLocation
|
||||
return {};
|
||||
}
|
||||
|
||||
void ConnectionFromClient::close_server()
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
|
||||
Messages::WebContentServer::GetWindowHandleResponse ConnectionFromClient::get_window_handle(u64 page_id)
|
||||
{
|
||||
if (auto page = this->page(page_id); page.has_value())
|
||||
|
||||
@@ -53,6 +53,7 @@ private:
|
||||
Optional<PageClient&> page(u64 index, SourceLocation = SourceLocation::current());
|
||||
Optional<PageClient const&> page(u64 index, SourceLocation = SourceLocation::current()) const;
|
||||
|
||||
virtual void close_server() override;
|
||||
virtual Messages::WebContentServer::GetWindowHandleResponse get_window_handle(u64 page_id) override;
|
||||
virtual void set_window_handle(u64 page_id, String const& handle) override;
|
||||
virtual void connect_to_webdriver(u64 page_id, ByteString const& webdriver_ipc_path) override;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
endpoint WebContentServer
|
||||
{
|
||||
close_server() =|
|
||||
|
||||
get_window_handle(u64 page_id) => (String handle)
|
||||
set_window_handle(u64 page_id, String handle) =|
|
||||
|
||||
|
||||
Reference in New Issue
Block a user