1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

Ladybird+LibWebView: Move options used to launch WebContent to a struct

It is currently a bit messy to pass these options along from main() to
where WebContent is actually launched. If a new flag were to be added,
there are a couple dozen files that need to be updated to pass that flag
along. With this change, the flag can just be added to the struct, set
in main(), and handled in launch_web_content_process().
This commit is contained in:
Timothy Flynn 2023-12-01 12:18:40 -05:00 committed by Tim Flynn
parent 8504d8f588
commit 07e9a8f79b
22 changed files with 104 additions and 74 deletions

View file

@ -25,6 +25,7 @@
// This will always be populated, but we cannot have a non-default constructible instance variable.
Optional<WebView::CookieJar> m_cookie_jar;
Ladybird::WebContentOptions m_web_content_options;
Optional<StringView> m_webdriver_content_ipc_path;
Web::CSS::PreferredColorScheme m_preferred_color_scheme;
@ -52,6 +53,7 @@
- (instancetype)init:(Vector<URL>)initial_urls
newTabPageURL:(URL)new_tab_page_url
withCookieJar:(WebView::CookieJar)cookie_jar
webContentOptions:(Ladybird::WebContentOptions const&)web_content_options
webdriverContentIPCPath:(StringView)webdriver_content_ipc_path
{
if (self = [super init]) {
@ -75,6 +77,8 @@
m_cookie_jar = move(cookie_jar);
m_web_content_options = web_content_options;
if (!webdriver_content_ipc_path.is_empty()) {
m_webdriver_content_ipc_path = webdriver_content_ipc_path;
}
@ -122,6 +126,11 @@
return *m_cookie_jar;
}
- (Ladybird::WebContentOptions const&)webContentOptions
{
return m_web_content_options;
}
- (Optional<StringView> const&)webdriverContentIPCPath
{
return m_webdriver_content_ipc_path;