From 7dd1864ad04912e7fc88f0ba4cb184ac9658db08 Mon Sep 17 00:00:00 2001 From: Chris Dumez Date: Tue, 2 May 2023 08:41:04 -0700 Subject: [PATCH] [macOS] Show more accurate names for child processes in Activity Monitor https://bugs.webkit.org/show_bug.cgi?id=256174 rdar://102152759 Reviewed by Per Arne Vollan and Tim Horton. See radar for more information. * Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::ProcessLauncher::launchProcess): Canonical link: https://commits.webkit.org/263588@main --- .../WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm b/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm index 0ea9a49dceba..7371e2b9ee88 100644 --- a/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm +++ b/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm @@ -179,7 +179,11 @@ xpc_dictionary_set_string(bootstrapMessage.get(), "client-identifier", !clientIdentifier.isEmpty() ? clientIdentifier.utf8().data() : *_NSGetProgname()); xpc_dictionary_set_string(bootstrapMessage.get(), "client-bundle-identifier", WebCore::applicationBundleIdentifier().utf8().data()); xpc_dictionary_set_string(bootstrapMessage.get(), "process-identifier", String::number(m_launchOptions.processIdentifier.toUInt64()).utf8().data()); +#if PLATFORM(MAC) + xpc_dictionary_set_string(bootstrapMessage.get(), "ui-process-name", [[[NSRunningApplication currentApplication] localizedName] UTF8String]); +#else xpc_dictionary_set_string(bootstrapMessage.get(), "ui-process-name", [[[NSProcessInfo processInfo] processName] UTF8String]); +#endif xpc_dictionary_set_string(bootstrapMessage.get(), "service-name", name); if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web) {