LibWeb+WebContent: Remove "chrome" from generated page template strings

This commit is contained in:
Timothy Flynn 2025-03-15 16:50:24 -04:00 committed by Tim Flynn
commit 6078143241
Notes: github-actions[bot] 2025-03-15 23:59:04 +00:00
3 changed files with 15 additions and 15 deletions

View file

@ -16,14 +16,17 @@
namespace Web {
void set_chrome_process_command_line(StringView command_line)
static String s_browser_process_command_line;
static String s_browser_process_executable_path;
void set_browser_process_command_line(StringView command_line)
{
s_chrome_process_command_line = MUST(String::from_utf8(command_line));
s_browser_process_command_line = MUST(String::from_utf8(command_line));
}
void set_chrome_process_executable_path(StringView executable_path)
void set_browser_process_executable_path(StringView executable_path)
{
s_chrome_process_executable_path = MUST(String::from_utf8(executable_path));
s_browser_process_executable_path = MUST(String::from_utf8(executable_path));
}
ErrorOr<String> load_error_page(URL::URL const& url, StringView error_message)
@ -92,8 +95,8 @@ ErrorOr<String> load_about_version_page()
generator.set("arch_name", CPU_STRING);
generator.set("os_name", OS_STRING);
generator.set("user_agent", default_user_agent);
generator.set("command_line", s_chrome_process_command_line);
generator.set("executable_path", s_chrome_process_executable_path);
generator.set("command_line", s_browser_process_command_line);
generator.set("executable_path", s_browser_process_executable_path);
generator.append(template_file->data());
return TRY(String::from_utf8(generator.as_string_view()));
}

View file

@ -11,11 +11,8 @@
namespace Web {
static String s_chrome_process_command_line {};
static String s_chrome_process_executable_path {};
void set_chrome_process_command_line(StringView command_line);
void set_chrome_process_executable_path(StringView executable_path);
void set_browser_process_command_line(StringView command_line);
void set_browser_process_executable_path(StringView executable_path);
ErrorOr<String> load_error_page(URL::URL const&, StringView error_message);

View file

@ -112,8 +112,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
StringView echo_server_port_string_view {};
Core::ArgsParser args_parser;
args_parser.add_option(command_line, "Chrome process command line", "command-line", 0, "command_line");
args_parser.add_option(executable_path, "Chrome process executable path", "executable-path", 0, "executable_path");
args_parser.add_option(command_line, "Browser process command line", "command-line", 0, "command_line");
args_parser.add_option(executable_path, "Browser process executable path", "executable-path", 0, "executable_path");
args_parser.add_option(config_path, "Ladybird configuration path", "config-path", 0, "config_path");
args_parser.add_option(request_server_socket, "File descriptor of the socket for the RequestServer connection", "request-server-socket", 'r', "request_server_socket");
args_parser.add_option(image_decoder_socket, "File descriptor of the socket for the ImageDecoder connection", "image-decoder-socket", 'i', "image_decoder_socket");
@ -151,8 +151,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
force_cpu_painting = true;
}
Web::set_chrome_process_command_line(command_line);
Web::set_chrome_process_executable_path(executable_path);
Web::set_browser_process_command_line(command_line);
Web::set_browser_process_executable_path(executable_path);
// Always use the CPU backend for layout tests, as the GPU backend is not deterministic
WebContent::PageClient::set_use_skia_painter(force_cpu_painting ? WebContent::PageClient::UseSkiaPainter::CPUBackend : WebContent::PageClient::UseSkiaPainter::GPUBackendIfAvailable);