Skip to content

Commit

Permalink
Change bundle ID for WebKit extensions
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267092
rdar://120485965

Reviewed by Elliott Williams.

Change bundle ID for WebKit extensions to match the XPC service variants.
This will make sure existing WebKit bundle ID checks still succeed.

* Source/WebKit/Configurations/BaseExtension.xcconfig:
* Source/WebKit/Configurations/GPUExtension.xcconfig:
* Source/WebKit/Configurations/NetworkingExtension.xcconfig:
* Source/WebKit/Configurations/WebContentCaptivePortalExtension.xcconfig:
* Source/WebKit/Configurations/WebContentExtension.xcconfig:
* Source/WebKit/Scripts/process-entitlements.sh:
* Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::launchProcess):
(WebKit::serviceNameAndIdentifier):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/272766@main
  • Loading branch information
pvollan committed Jan 8, 2024
1 parent 9fb944e commit 96bf3e7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Source/WebKit/Configurations/BaseExtension.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_INSTRUMENT_FOR_OPTIMIZATION_PROFILING = NO;
INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/$(WK_FRAMEWORK_VERSION_PREFIX)Extensions;
INSTALL_PATH = $(WK_INSTALL_PATH_PREFIX)/System/Library/ExtensionKit/Extensions;
SWIFT_OBJC_BRIDGING_HEADER = $(SWIFT_OBJC_BRIDGING_HEADER_$(USE_INTERNAL_SDK));
SWIFT_OBJC_BRIDGING_HEADER_ = ;
SWIFT_OBJC_BRIDGING_HEADER_YES = ;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/Configurations/GPUExtension.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

INFOPLIST_FILE = Shared/AuxiliaryProcessExtensions/GPUExtension-Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = GPUExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.GPUExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.GPU;
PRODUCT_BUNDLE_EXECUTABLE = GPUExtension;
PRODUCT_BUNDLE_NAME = GPUExtension;
2 changes: 1 addition & 1 deletion Source/WebKit/Configurations/NetworkingExtension.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

INFOPLIST_FILE = Shared/AuxiliaryProcessExtensions/NetworkingExtension-Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = NetworkingExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.NetworkingExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.Networking;
PRODUCT_BUNDLE_EXECUTABLE = NetworkingExtension;
PRODUCT_BUNDLE_NAME = NetworkingExtension;
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

INFOPLIST_FILE = Shared/AuxiliaryProcessExtensions/WebContentExtension-CaptivePortal-Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = WebContentCaptivePortalExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.WebContentExtension.CaptivePortal;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.WebContent.CaptivePortal;
PRODUCT_BUNDLE_EXECUTABLE = WebContentCaptivePortalExtension;
PRODUCT_BUNDLE_NAME = WebContentCaptivePortalExtension;
2 changes: 1 addition & 1 deletion Source/WebKit/Configurations/WebContentExtension.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

INFOPLIST_FILE = Shared/AuxiliaryProcessExtensions/WebContentExtension-Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = WebContentExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.WebContentExtension;
PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.WebContent;
PRODUCT_BUNDLE_EXECUTABLE = WebContentExtension;
PRODUCT_BUNDLE_NAME = WebContentExtension;
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
switch (processType) {
case ProcessLauncher::ProcessType::Web: {
if (client && client->shouldEnableLockdownMode())
return { "com.apple.WebKit.WebContent"_s, @"com.apple.WebKit.WebContentExtension.CaptivePortal" };
return { "com.apple.WebKit.WebContent"_s, @"com.apple.WebKit.WebContentExtension" };
return { "com.apple.WebKit.WebContent"_s, @"com.apple.WebKit.WebContent.CaptivePortal" };
return { "com.apple.WebKit.WebContent"_s, @"com.apple.WebKit.WebContent" };
}
case ProcessLauncher::ProcessType::Network:
return { "com.apple.WebKit.Networking"_s, @"com.apple.WebKit.NetworkingExtension" };
return { "com.apple.WebKit.Networking"_s, @"com.apple.WebKit.Networking" };
#if ENABLE(GPU_PROCESS)
case ProcessLauncher::ProcessType::GPU:
return { "com.apple.WebKit.GPU"_s, @"com.apple.WebKit.GPUExtension" };
return { "com.apple.WebKit.GPU"_s, @"com.apple.WebKit.GPU" };
#endif
}
}
Expand Down Expand Up @@ -159,6 +159,7 @@ static void launchWithExtensionKit(ProcessLauncher& processLauncher, ProcessLaun
}
if (error) {
NSLog(@"Error launching process %@ error %@", process, error);
RELEASE_LOG_FAULT(Process, "Error launching process, descriptrion '%s', reason '%s'", String([error localizedDescription]).utf8().data(), String([error localizedFailureReason]).utf8().data());
callOnMainRunLoop([weakProcessLauncher = weakProcessLauncher] {
auto launcher = weakProcessLauncher.get();
if (!launcher)
Expand Down
8 changes: 4 additions & 4 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
buildConfigurationList = 1A50DB48110A3C27000D3FE5 /* Build configuration list for PBXAggregateTarget "Framework, XPC Services, Extensions, and daemons" */;
buildPhases = (
DDFA47222AA93C7F00C7C788 /* Check For Inappropriate Files In Framework */,
E3322DA32ACB68E2001194DA /* Copy extension (temporary workaround) */,
E3322DA32ACB68E2001194DA /* Update extension points (temporary workaround) */,
);
dependencies = (
5C400E6A29DB8AB500446F6F /* PBXTargetDependency */,
Expand Down Expand Up @@ -18014,7 +18014,7 @@
shellPath = /bin/sh;
shellScript = "echo \"Preprocessing sandbox\"\nScripts/generate-derived-sources.sh sandbox-profiles-ios\nmkdir -p ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.adattributiond.sb ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.webpushd.sb ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.GPU.sb ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.Networking.sb ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.WebAuthn.sb ${DSTROOT}/${INSTALL_PATH}\ncp ${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/com.apple.WebKit.WebContent.sb ${DSTROOT}/${INSTALL_PATH}\n";
};
E3322DA32ACB68E2001194DA /* Copy extension (temporary workaround) */ = {
E3322DA32ACB68E2001194DA /* Update extension points (temporary workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -18023,14 +18023,14 @@
);
inputPaths = (
);
name = "Copy extension (temporary workaround)";
name = "Update extension points (temporary workaround)";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [[ ${WK_PLATFORM_NAME} == \"macosx\" ]]; then\n exit\nfi\n\nEXTENSIONS_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/Extensions\"\n\nif [[ ! -e \"${EXTENSIONS_PATH}/NetworkingExtension.appex\" ]]; then\n exit\nfi\n\ncopyExtensions() {\n DESTINATION_PATH=$1\n DOMAIN=$2\n mkdir -p \"${DESTINATION_PATH}\"\n\n ditto \"${EXTENSIONS_PATH}/NetworkingExtension.appex\" \"${DESTINATION_PATH}/NetworkingExtension.appex\"\n ditto \"${EXTENSIONS_PATH}/GPUExtension.appex\" \"${DESTINATION_PATH}/GPUExtension.appex\"\n ditto \"${EXTENSIONS_PATH}/WebContentExtension.appex\" \"${DESTINATION_PATH}/WebContentExtension.appex\"\n ditto \"${EXTENSIONS_PATH}/WebContentCaptivePortalExtension.appex\" \"${DESTINATION_PATH}/WebContentCaptivePortalExtension.appex\"\n\n /usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier ${DOMAIN}.NetworkingExtension\" \"${DESTINATION_PATH}/NetworkingExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier ${DOMAIN}.GPUExtension\" \"${DESTINATION_PATH}/GPUExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier ${DOMAIN}.WebContentExtension\" \"${DESTINATION_PATH}/WebContentExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier ${DOMAIN}.WebContentCaptivePortalExtension\" \"${DESTINATION_PATH}/WebContentCaptivePortalExtension.appex/Info.plist\"\n\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/NetworkingExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/GPUExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/WebContentExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/WebContentCaptivePortalExtension.appex/Info.plist\"\n\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.networking\" \"${DESTINATION_PATH}/NetworkingExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.gpu\" \"${DESTINATION_PATH}/GPUExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.content\" \"${DESTINATION_PATH}/WebContentExtension.appex/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.content\" \"${DESTINATION_PATH}/WebContentCaptivePortalExtension.appex/Info.plist\"\n}\n\ncopyExtensions \"${DSTROOT}/System/Library/ExtensionKit/Extensions\" \"com.apple.WebKit\"\n";
shellScript = "if [[ ${WK_PLATFORM_NAME} == \"macosx\" ]]; then\n exit\nfi\n\nEXTENSIONS_PATH=\"${DSTROOT}/System/Library/ExtensionKit/Extensions\"\n\nNETWORKING_BUNDLE=\"NetworkingExtension.appex\"\nGPU_BUNDLE=\"GPUExtension.appex\"\nWEBCONTENT_BUNDLE=\"WebContentExtension.appex\"\nWEBCONTENT_CAPTIVEPORTAL_BUNDLE=\"WebContentCaptivePortalExtension.appex\"\n\nif [[ ! -e \"${EXTENSIONS_PATH}/${NETWORKING_BUNDLE}\" ]]; then\n exit\nfi\n\nupdateExtensionPoints() {\n DESTINATION_PATH=$1\n\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/${NETWORKING_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/${GPU_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/${WEBCONTENT_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/${WEBCONTENT_CAPTIVEPORTAL_BUNDLE}/Info.plist\"\n\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.networking\" \"${DESTINATION_PATH}/${NETWORKING_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.gpu\" \"${DESTINATION_PATH}/${GPU_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.content\" \"${DESTINATION_PATH}/${WEBCONTENT_BUNDLE}/Info.plist\"\n /usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string com.apple.web-browser-engine.content\" \"${DESTINATION_PATH}/${WEBCONTENT_CAPTIVEPORTAL_BUNDLE}/Info.plist\"\n}\n\nupdateExtensionPoints \"${EXTENSIONS_PATH}\"\n";
};
E352B54F2AB25EA8006F6B0D /* Process entitlements */ = {
isa = PBXShellScriptBuildPhase;
Expand Down

0 comments on commit 96bf3e7

Please sign in to comment.