Skip to content

Commit

Permalink
Enable management of WebKit process as extensions by default
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264316
rdar://118035310

Reviewed by Brent Fulgham.

This means ExtensionKit SPI will be used to launch WebKit processes, and provide them with run time.

* Source/WebKit/UIProcess/Cocoa/ProcessAssertionCocoa.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Canonical link: https://commits.webkit.org/270583@main
  • Loading branch information
pvollan committed Nov 11, 2023
1 parent dad9c56 commit 1f8870d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/Cocoa/ProcessAssertionCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ - (void)assertion:(RBSAssertion *)assertion didInvalidateWithError:(NSError *)er
, m_reason(reason)
{
#if USE(EXTENSIONKIT)
if (AuxiliaryProcessProxy::manageProcessesAsExtensions()) {
if (process.extensionProcess()) {
NSString *runningBoardAssertionName = runningBoardNameForAssertionType(m_assertionType);
NSString *runningBoardDomain = runningBoardDomainForAssertionType(m_assertionType);
m_capabilities = [get_SECapabilitiesClass() assertionWithDomain:runningBoardDomain name:runningBoardAssertionName];
Expand Down
3 changes: 2 additions & 1 deletion Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ static void logProcessPoolState(const WebProcessPool& pool)
});

#if USE(EXTENSIONKIT)
AuxiliaryProcessProxy::setManageProcessesAsExtensions(CFPreferencesGetAppBooleanValue(CFSTR("manageProcessesAsExtensions"), CFSTR("com.apple.WebKit"), nullptr));
bool manageProcessesAsExtensions = !CFPreferencesGetAppBooleanValue(CFSTR("disableProcessesAsExtensions"), kCFPreferencesCurrentApplication, nullptr);
AuxiliaryProcessProxy::setManageProcessesAsExtensions(manageProcessesAsExtensions);
#endif
}

Expand Down
5 changes: 5 additions & 0 deletions Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ static void setVideoDecoderBehaviors(OptionSet<VideoDecoderBehavior> videoDecode
{
WEBPROCESS_RELEASE_LOG(Process, "WebProcess::platformInitializeWebProcess");

#if USE(EXTENSIONKIT)
// Workaround for crash seen when running tests. See rdar://118186487.
unsetenv("BSServiceDomains");
#endif

applyProcessCreationParameters(parameters.auxiliaryProcessParameters);

setQOS(parameters.latencyQOS, parameters.throughputQOS);
Expand Down

0 comments on commit 1f8870d

Please sign in to comment.