mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
ImageDecoder: Register with mach server on macOS
This allows viewing the resource usage in the task manager widget
This commit is contained in:
committed by
Andrew Kaster
parent
4b5541e1b7
commit
e7ece774a2
@@ -12,12 +12,26 @@
|
||||
#include <LibIPC/SingleServer.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
#if defined(AK_OS_MACOS)
|
||||
# include <LibCore/Platform/ProcessStatisticsMach.h>
|
||||
#endif
|
||||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
AK::set_rich_debug_enabled(true);
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
StringView mach_server_name;
|
||||
args_parser.add_option(mach_server_name, "Mach server name", "mach-server-name", 0, "mach_server_name");
|
||||
args_parser.parse(arguments);
|
||||
|
||||
Core::EventLoop event_loop;
|
||||
|
||||
#if defined(AK_OS_MACOS)
|
||||
if (!mach_server_name.is_empty())
|
||||
Core::Platform::register_with_mach_server(mach_server_name);
|
||||
#endif
|
||||
|
||||
auto client = TRY(IPC::take_over_accepted_client_from_system_server<ImageDecoder::ConnectionFromClient>());
|
||||
|
||||
return event_loop.exec();
|
||||
|
||||
Reference in New Issue
Block a user