mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibDevTools: Only send network response bodies when DevTools connected
To avoid unnecessary IPC traffic, we now only send network response bodies when a DevTools client is connected. This requires tracking DevTools connection state in ViewImplementation so we can propagate it to new WebContent processes created during cross-site navigation.
This commit is contained in:
committed by
Andreas Kling
parent
0c7292e05c
commit
770811e343
Notes:
github-actions[bot]
2026-01-15 19:11:21 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/770811e343c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7472 Reviewed-by: https://github.com/trflynn89
@@ -335,6 +335,18 @@ void ViewImplementation::set_listen_for_dom_mutations(bool listen_for_dom_mutati
|
||||
client().async_set_listen_for_dom_mutations(page_id(), listen_for_dom_mutations);
|
||||
}
|
||||
|
||||
void ViewImplementation::did_connect_devtools_client()
|
||||
{
|
||||
m_devtools_connected = true;
|
||||
client().async_did_connect_devtools_client(page_id());
|
||||
}
|
||||
|
||||
void ViewImplementation::did_disconnect_devtools_client()
|
||||
{
|
||||
m_devtools_connected = false;
|
||||
client().async_did_disconnect_devtools_client(page_id());
|
||||
}
|
||||
|
||||
void ViewImplementation::get_dom_node_inner_html(Web::UniqueNodeID node_id)
|
||||
{
|
||||
client().async_get_dom_node_inner_html(page_id(), node_id);
|
||||
@@ -583,6 +595,10 @@ void ViewImplementation::initialize_client(CreateNewClient create_new_client)
|
||||
languages_changed();
|
||||
autoplay_settings_changed();
|
||||
global_privacy_control_changed();
|
||||
|
||||
// If DevTools is connected, notify the new WebContent process.
|
||||
if (m_devtools_connected)
|
||||
client().async_did_connect_devtools_client(page_id());
|
||||
}
|
||||
|
||||
void ViewImplementation::handle_web_content_process_crash(LoadErrorPage load_error_page)
|
||||
|
||||
Reference in New Issue
Block a user