Add SPI for launching WebContent process with pre-linked injected bundle
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 21:04:43 +0000 (21:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 21:04:43 +0000 (21:04 +0000)
commit56ddeb6f75bf7ec47a8309c2874b413c57e3d17d
treecc0a7b0f9a0c6d378c725208f9e66bdac59fd303
parenteead86a4074b02adc44105fc010b87fbe218cbd6
Add SPI for launching WebContent process with pre-linked injected bundle
https://bugs.webkit.org/show_bug.cgi?id=188367

Patch by Ben Richards <benton_richards@apple.com> on 2018-08-07
Reviewed by Ryosuke Niwa.

Added SPI to allow applications to set a "customWebContentServiceBundleIdentifier" which will be launched instead of the default WebContent XPC service.
The "customWebContentServiceBundleIdentifier" should be the bundle identifier for an XPC service that calls [WKProcessPool _webContentProcessXPCMain].
The new XPC service should be hard linked to the application's injected bundle in order to receive the intended performance benefit.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
(main):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCustomWebContentServiceBundleIdentifier):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(+[WKProcessPool _webContentProcessXPCMain]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration customWebContentServiceBundleIdentifier]):
(-[_WKProcessPoolConfiguration setCustomWebContentServiceBundleIdentifier:]):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setCustomWebContentServiceBundleIdentifier):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/C/WKContext.cpp
Source/WebKit/UIProcess/API/C/WKContext.h
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
Source/WebKit/UIProcess/Launcher/ProcessLauncher.h
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/WebProcessProxy.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj