LibWebView: Add a command line flag to enable the HTTP disk cache

This adds a RequestServerOptions structure to hold this option and the
only other RS option we currently have (certificates).
This commit is contained in:
Timothy Flynn 2025-10-08 21:17:05 -04:00 committed by Andreas Kling
parent 3516a2344f
commit 42eaea1043
Notes: github-actions[bot] 2025-10-14 11:41:44 +00:00
4 changed files with 26 additions and 3 deletions

View file

@ -201,17 +201,23 @@ ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process(Web
ErrorOr<NonnullRefPtr<Requests::RequestClient>> launch_request_server_process()
{
auto const& request_server_options = Application::request_server_options();
Vector<ByteString> arguments;
for (auto const& certificate : WebView::Application::browser_options().certificates)
for (auto const& certificate : request_server_options.certificates)
arguments.append(ByteString::formatted("--certificate={}", certificate));
if (request_server_options.enable_http_disk_cache == EnableHTTPDiskCache::Yes)
arguments.append("--enable-http-disk-cache"sv);
if (auto server = mach_server_name(); server.has_value()) {
arguments.append("--mach-server-name"sv);
arguments.append(server.value());
}
auto client = TRY(launch_server_process<Requests::RequestClient>("RequestServer"sv, move(arguments)));
WebView::Application::settings().dns_settings().visit(
[](WebView::SystemDNS) {},
[&](WebView::DNSOverTLS const& dns_over_tls) {