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:
Andreas Kling
2026-01-15 14:28:42 +01:00
committed by Andreas Kling
parent 0c7292e05c
commit 770811e343
Notes: github-actions[bot] 2026-01-15 19:11:21 +00:00
11 changed files with 86 additions and 0 deletions

View File

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