mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Ladybird: Add a command line flag to disable launching SQLServer
This commit is contained in:
parent
a01ad58e91
commit
3d0ac399c4
Notes:
sideshowbarker
2024-07-17 03:03:37 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/3d0ac399c4 Pull-request: https://github.com/SerenityOS/serenity/pull/18446
@ -68,12 +68,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
StringView raw_url;
|
||||
StringView webdriver_content_ipc_path;
|
||||
bool enable_callgrind_profiling = false;
|
||||
bool disable_sql_database = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.set_general_help("The Ladybird web browser :^)");
|
||||
args_parser.add_positional_argument(raw_url, "URL to open", "url", Core::ArgsParser::Required::No);
|
||||
args_parser.add_option(webdriver_content_ipc_path, "Path to WebDriver IPC for WebContent", "webdriver-content-path", 0, "path");
|
||||
args_parser.add_option(enable_callgrind_profiling, "Enable Callgrind profiling", "enable-callgrind-profiling", 'P');
|
||||
args_parser.add_option(disable_sql_database, "Disable SQL database", "disable-sql-database", 0);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
auto get_formatted_url = [&](StringView const& raw_url) -> ErrorOr<URL> {
|
||||
@ -85,11 +87,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
return url;
|
||||
};
|
||||
|
||||
auto sql_server_paths = TRY(get_paths_for_helper_process("SQLServer"sv));
|
||||
auto sql_client = TRY(SQL::SQLClient::launch_server_and_create_client(move(sql_server_paths)));
|
||||
auto database = TRY(Browser::Database::create(move(sql_client)));
|
||||
RefPtr<Browser::Database> database;
|
||||
|
||||
auto cookie_jar = TRY(Browser::CookieJar::create(*database));
|
||||
if (!disable_sql_database) {
|
||||
auto sql_server_paths = TRY(get_paths_for_helper_process("SQLServer"sv));
|
||||
auto sql_client = TRY(SQL::SQLClient::launch_server_and_create_client(move(sql_server_paths)));
|
||||
database = TRY(Browser::Database::create(move(sql_client)));
|
||||
}
|
||||
|
||||
auto cookie_jar = database ? TRY(Browser::CookieJar::create(*database)) : Browser::CookieJar::create();
|
||||
|
||||
s_settings = adopt_own_if_nonnull(new Browser::Settings());
|
||||
BrowserWindow window(cookie_jar, webdriver_content_ipc_path, enable_callgrind_profiling ? WebView::EnableCallgrindProfiling::Yes : WebView::EnableCallgrindProfiling::No);
|
||||
|
Loading…
Reference in New Issue
Block a user