-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: User-friendly name for the GPUProcess no longer gets set #15356
Regression: User-friendly name for the GPUProcess no longer gets set #15356
Conversation
EWS run on previous version of this PR (hash 1bdbbe4) |
@@ -63,8 +63,19 @@ | |||
void GPUProcess::initializeProcessName(const AuxiliaryProcessInitializationParameters& parameters) | |||
{ | |||
#if !PLATFORM(MACCATALYST) | |||
// Register the application. This will also check in with Launch Services. | |||
// This is necessary to set the process name. | |||
_RegisterApplication(nullptr, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be sufficient to just check in with Launch Services? I do not think the Networking process calls _RegisterApplication?
// Set process name before initializing the sandbox as we may need to | ||
// connect to launch services to set the name and the sandbox doesn't | ||
// necessarily allow it. | ||
initializeProcessName(parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could create a sandbox extension for Launch Services, which would be revoked after setting the process name?
1bdbbe4
to
84d791b
Compare
EWS run on previous version of this PR (hash 84d791b) |
84d791b
to
0376f7b
Compare
EWS run on previous version of this PR (hash 0376f7b) |
_LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSPersistenceSuppressRelaunchAtLoginKey, kCFBooleanTrue, nullptr); | ||
|
||
if (launchServicesExtension) | ||
launchServicesExtension->revoke(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good if we closed any open LS connections here.
0376f7b
to
d0d40ce
Compare
EWS run on previous version of this PR (hash d0d40ce) |
// Disable relaunch on login. This is also done from -[NSApplication init] by dispatching -[NSApplication disableRelaunchOnLogin] on a non-main thread. | ||
// This will be in a race with the closing of the Launch Services connection, so call it synchronously here. | ||
// The cost of calling this should be small, and it is not expected to have any impact on performance. | ||
_LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSPersistenceSuppressRelaunchAtLoginKey, kCFBooleanTrue, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is required in the GPU process, since it was a workaround for a sandbox issue when NSApplication is being used in the WebContent process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! R=me.
d0d40ce
to
566993e
Compare
EWS run on current version of this PR (hash 566993e) |
// It is important to check in with launch services before setting the process name. | ||
launchServicesCheckIn(); | ||
|
||
// Update process name while holding the Launch Services sandbox extension | ||
updateProcessName(); | ||
|
||
// Close connection to launch services. | ||
#if HAVE(HAVE_LS_SERVER_CONNECTION_STATUS_RELEASE_NOTIFICATIONS_MASK) | ||
_LSSetApplicationLaunchServicesServerConnectionStatus(kLSServerConnectionStatusDoNotConnectToServerMask | kLSServerConnectionStatusReleaseNotificationsMask, nullptr); | ||
#else | ||
_LSSetApplicationLaunchServicesServerConnectionStatus(kLSServerConnectionStatusDoNotConnectToServerMask, nullptr); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this could be moved into the if (launchServicesExtension) clause, since it will not work without the extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it hurt to keep as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping as-is is fine :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, too, assuming you adopt Per Arne's requested changes.
https://bugs.webkit.org/show_bug.cgi?id=258600 Reviewed by Per Arne Vollan and Brent Fulgham. Access to launch services has been blocked by the GPUProcess' sandbox. As a result, the GPUProcess no longer gets a user-friendly name in Activity Monitor. To address the issue, we now: 1. Have the UIProcess create a sandbox extension for launch services and send it to the GPUProcess to temporarily consume it during initialization 2. The GPUProcess, on initialization now consumes this extension 3. The GPUProcess checks in with Launch Services and sets the process name 4. The GPUProcess closes connections to launch services 5. The GPUProcess revokes the sandbox extension * Source/WebKit/GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Source/WebKit/GPUProcess/GPUProcess.h: * Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * Source/WebKit/GPUProcess/GPUProcessCreationParameters.h: * Source/WebKit/GPUProcess/cocoa/GPUProcessCocoa.mm: (WebKit::GPUProcess::platformInitializeGPUProcess): * Source/WebKit/GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::initializeProcessName): (WebKit::GPUProcess::updateProcessName): * Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm: (WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters): Canonical link: https://commits.webkit.org/265610@main
566993e
to
73df24e
Compare
Committed 265610@main (73df24e): https://commits.webkit.org/265610@main Reviewed commits have been landed. Closing PR #15356 and removing active labels. |
73df24e
566993e