Skip to content

Commit

Permalink
Unreviewed, reverting 279946@main.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=275405

Introduced test failures

Reverted changeset:

"Local WebKit builds don't use locally-built WebKit process extensions"
https://bugs.webkit.org/show_bug.cgi?id=273550
https://commits.webkit.org/279946@main

Canonical link: https://commits.webkit.org/279949@main
  • Loading branch information
webkit-commit-queue authored and mnutt committed Jun 30, 2024
1 parent b217f18 commit 355516c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 83 deletions.
8 changes: 1 addition & 7 deletions Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,13 @@ static bool isInWebKitChildProcess()

static dispatch_once_t once;
dispatch_once(&once, ^{
#if USE(EXTENSIONKIT)
isInSubProcess |= WTF::processHasEntitlement("com.apple.developer.web-browser-engine.networking"_s)
|| WTF::processHasEntitlement("com.apple.developer.web-browser-engine.rendering"_s)
|| WTF::processHasEntitlement("com.apple.developer.web-browser-engine.webcontent"_s);
#else
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
isInSubProcess = [bundleIdentifier hasPrefix:@"com.apple.WebKit.WebContent"]
|| [bundleIdentifier hasPrefix:@"com.apple.WebKit.Networking"]
|| [bundleIdentifier hasPrefix:@"com.apple.WebKit.GPU"];
#if ENABLE(MODEL_PROCESS)
isInSubProcess = isInSubProcess || [bundleIdentifier hasPrefix:@"com.apple.WebKit.Model"];
#endif // ENABLE(MODEL_PROCESS)
#endif // USE(EXTENSIONKIT)
#endif
});

return isInSubProcess;
Expand Down
28 changes: 3 additions & 25 deletions Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,6 @@ static void launchWithExtensionKitFallback(ProcessLauncher& processLauncher, Pro
}
#endif // USE(LEGACY_EXTENSIONKIT_SPI)

#if !USE(LEGACY_EXTENSIONKIT_SPI)
static bool hasExtensionInAppBundle(NSString *name)
{
#if PLATFORM(IOS_SIMULATOR)
NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"appex" inDirectory:@"Extensions"];
return !!path;
#else
UNUSED_PARAM(name);
return false;
#endif
}
#endif // !USE(LEGACY_EXTENSIONKIT_SPI)

static void launchWithExtensionKit(ProcessLauncher& processLauncher, ProcessLauncher::ProcessType processType, ProcessLauncher::Client* client, WTF::Function<void(ThreadSafeWeakPtr<ProcessLauncher> weakProcessLauncher, ExtensionProcess&& process, ASCIILiteral name, NSError *error)>&& handler)
{
#if USE(LEGACY_EXTENSIONKIT_SPI)
Expand All @@ -151,30 +138,21 @@ static void launchWithExtensionKit(ProcessLauncher& processLauncher, ProcessLaun
auto block = makeBlockPtr([handler = WTFMove(handler), weakProcessLauncher = ThreadSafeWeakPtr { processLauncher }, name = name](BEWebContentProcess *_Nullable process, NSError *_Nullable error) {
handler(WTFMove(weakProcessLauncher), process, name, error);
});
if (hasExtensionInAppBundle(@"WebContentExtension"))
[BEWebContentProcess webContentProcessWithInterruptionHandler:^{ } completion:block.get()];
else
[BEWebContentProcess webContentProcessWithBundleID:identifier.get() interruptionHandler:^{ } completion:block.get()];
[BEWebContentProcess webContentProcessWithBundleID:identifier.get() interruptionHandler: ^{ } completion:block.get()];
break;
}
case ProcessLauncher::ProcessType::Network: {
auto block = makeBlockPtr([handler = WTFMove(handler), weakProcessLauncher = ThreadSafeWeakPtr { processLauncher }, name = name](BENetworkingProcess *_Nullable process, NSError *_Nullable error) {
handler(WTFMove(weakProcessLauncher), process, name, error);
});
if (hasExtensionInAppBundle(@"NetworkingExtension"))
[BENetworkingProcess networkProcessWithInterruptionHandler:^{ } completion:block.get()];
else
[BENetworkingProcess networkProcessWithBundleID:identifier.get() interruptionHandler:^{ } completion:block.get()];
[BENetworkingProcess networkProcessWithBundleID:identifier.get() interruptionHandler: ^{ } completion:block.get()];
break;
}
case ProcessLauncher::ProcessType::GPU: {
auto block = makeBlockPtr([handler = WTFMove(handler), weakProcessLauncher = ThreadSafeWeakPtr { processLauncher }, name = name](BERenderingProcess *_Nullable process, NSError *_Nullable error) {
handler(WTFMove(weakProcessLauncher), process, name, error);
});
if (hasExtensionInAppBundle(@"GPUExtension"))
[BERenderingProcess renderingProcessWithInterruptionHandler:^{ } completion:block.get()];
else
[BERenderingProcess renderingProcessWithBundleID:identifier.get() interruptionHandler:^{ } completion:block.get()];
[BERenderingProcess renderingProcessWithBundleID:identifier.get() interruptionHandler: ^{ } completion:block.get()];
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@
<true/>
<key>com.apple.runningboard.launch_extensions</key>
<true/>
<key>com.apple.developer.web-browser</key>
<true/>
<key>com.apple.developer.web-browser-engine.host</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ STRIP_STYLE = debugging;

SKIP_INSTALL[sdk=macosx*] = YES;

EXCLUDED_SOURCE_FILE_NAMES[config=Production] = $(inherited) *.appex
EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = $(inherited) ios/* AppDelegate.m *.appex;
EXCLUDED_SOURCE_FILE_NAMES[sdk=appletv*] = $(inherited) ios/Launch.storyboard *.appex;
EXCLUDED_SOURCE_FILE_NAMES[sdk=watch*] = $(inherited) ios/Launch.storyboard *.appex;
EXCLUDED_SOURCE_FILE_NAMES[sdk=xr*] = $(inherited) *.appex;
EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = ios/* AppDelegate.m;
EXCLUDED_SOURCE_FILE_NAMES[sdk=appletv*] = ios/Launch.storyboard;
EXCLUDED_SOURCE_FILE_NAMES[sdk=watch*] = ios/Launch.storyboard;

TARGETED_DEVICE_FAMILY = 1,2,4,7;

CODE_SIGN_ENTITLEMENTS[sdk=iphone*] = Configurations/WebKitTestRunnerApp-iOS.entitlements;
CODE_SIGN_ENTITLEMENTS[sdk=appletv*] = Configurations/WebKitTestRunnerApp-watchOS.entitlements;
CODE_SIGN_ENTITLEMENTS[sdk=watch*] = Configurations/WebKitTestRunnerApp-watchOS.entitlements;
CODE_SIGN_ENTITLEMENTS[sdk=xr*] = Configurations/WebKitTestRunnerApp-iOS.entitlements;

APPLY_RULES_IN_COPY_FILES = YES;
40 changes: 0 additions & 40 deletions Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@
E132AA3A17CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = E132AA3817CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.mm */; };
E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = E132AA3B17CE776F00611DF0 /* WebKitTestRunnerEvent.mm */; };
E1C642C617CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1C642C417CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm */; };
E372BC362C08E29C006DFE67 /* NetworkingExtension.appex in Embed Extensions */ = {isa = PBXBuildFile; fileRef = E372BC352C08E29C006DFE67 /* NetworkingExtension.appex */; platformFilters = (ios, ); settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
E372BC382C08EB01006DFE67 /* GPUExtension.appex in Embed Extensions */ = {isa = PBXBuildFile; fileRef = E372BC372C08EB01006DFE67 /* GPUExtension.appex */; platformFilters = (ios, ); settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
E372BC3A2C08F323006DFE67 /* WebContentExtension.appex in Embed Extensions */ = {isa = PBXBuildFile; fileRef = E372BC392C08F323006DFE67 /* WebContentExtension.appex */; platformFilters = (ios, ); settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
F4010B7E24DA205300A876E2 /* PoseAsClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4010B7C24DA204800A876E2 /* PoseAsClass.mm */; };
F415C22C27AF52D30028F505 /* UIPasteboardConsistencyEnforcer.h in Headers */ = {isa = PBXBuildFile; fileRef = F415C22A27AF52D30028F505 /* UIPasteboardConsistencyEnforcer.h */; };
F415C23527AF5B390028F505 /* UIPasteboardConsistencyEnforcer.mm in Sources */ = {isa = PBXBuildFile; fileRef = F415C22B27AF52D30028F505 /* UIPasteboardConsistencyEnforcer.mm */; };
Expand All @@ -177,22 +174,6 @@
F4FED324235823A3003C139C /* NSPasteboardAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4FED3222358215E003C139C /* NSPasteboardAdditions.mm */; };
/* End PBXBuildFile section */

/* Begin PBXBuildRule section */
E372BC2C2C08C74A006DFE67 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.proxy.script;
filePatterns = "*.appex";
fileType = pattern.proxy;
inputFiles = (
);
isEditable = 1;
outputFiles = (
"$(BUILT_PRODUCTS_DIR)/$(EXTENSIONS_FOLDER_PATH)/$(INPUT_FILE_NAME)",
);
script = "set -e\n\nDESTINATION_PATH=${BUILT_PRODUCTS_DIR}/WebKitTestRunnerApp.app/Extensions/${INPUT_FILE_NAME}\n\nmkdir -p \"${DESTINATION_PATH}\"\nditto \"${BUILT_PRODUCTS_DIR}/${INPUT_FILE_NAME}\" \"${DESTINATION_PATH}\"\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier ${PRODUCT_BUNDLE_IDENTIFIER}.${INPUT_FILE_BASE}\" \"${DESTINATION_PATH}/Info.plist\"\n\nif [[ ${INPUT_FILE_BASE} == \"WebContentExtension\" ]]; then\n EXTENSION_POINT_ID=\"com.apple.web-browser-engine.content\"\nelif [[ ${INPUT_FILE_BASE} == \"WebContentCaptivePortalExtension\" ]]; then\n EXTENSION_POINT_ID=\"com.apple.web-browser-engine.content\"\nfi\n\nif [[ -z \"${EXTENSION_POINT_ID}\" ]]; then\n exit 0\nfi\n\n/usr/libexec/PlistBuddy -c \"Delete :EXAppExtensionAttributes:EXExtensionPointIdentifier dict\" \"${DESTINATION_PATH}/Info.plist\"\n/usr/libexec/PlistBuddy -c \"Add :EXAppExtensionAttributes:EXExtensionPointIdentifier string ${EXTENSION_POINT_ID}\" \"${DESTINATION_PATH}/Info.plist\"\n";
};
/* End PBXBuildRule section */

/* Begin PBXContainerItemProxy section */
A115CCB91B9D76BF00E89159 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
Expand Down Expand Up @@ -250,19 +231,6 @@
name = "Copy Plug-Ins";
runOnlyForDeploymentPostprocessing = 0;
};
E372BC342C08E22D006DFE67 /* Embed Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "$(EXTENSIONS_FOLDER_PATH)";
dstSubfolderSpec = 16;
files = (
E372BC382C08EB01006DFE67 /* GPUExtension.appex in Embed Extensions */,
E372BC362C08E29C006DFE67 /* NetworkingExtension.appex in Embed Extensions */,
E372BC3A2C08F323006DFE67 /* WebContentExtension.appex in Embed Extensions */,
);
name = "Embed Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -474,9 +442,6 @@
E1BA671D1742DA5A00C20251 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
E1C642C417CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitTestRunnerPasteboard.mm; sourceTree = "<group>"; };
E1C642C517CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerPasteboard.h; sourceTree = "<group>"; };
E372BC352C08E29C006DFE67 /* NetworkingExtension.appex */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.extensionkit-extension"; path = NetworkingExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
E372BC372C08EB01006DFE67 /* GPUExtension.appex */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.extensionkit-extension"; path = GPUExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
E372BC392C08F323006DFE67 /* WebContentExtension.appex */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.extensionkit-extension"; path = WebContentExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
F4010B7C24DA204800A876E2 /* PoseAsClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PoseAsClass.mm; path = ../TestRunnerShared/cocoa/PoseAsClass.mm; sourceTree = "<group>"; };
F4010B7D24DA204800A876E2 /* PoseAsClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PoseAsClass.h; path = ../TestRunnerShared/cocoa/PoseAsClass.h; sourceTree = "<group>"; };
F415C22A27AF52D30028F505 /* UIPasteboardConsistencyEnforcer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIPasteboardConsistencyEnforcer.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -538,9 +503,6 @@
08FB7794FE84155DC02AAC07 /* WebKitTestRunner */ = {
isa = PBXGroup;
children = (
E372BC392C08F323006DFE67 /* WebContentExtension.appex */,
E372BC372C08EB01006DFE67 /* GPUExtension.appex */,
E372BC352C08E29C006DFE67 /* NetworkingExtension.appex */,
49AEEF692407278200C87E4C /* Info.plist */,
BC952EC511F3C10F003398B4 /* DerivedSources.make */,
2EE52CEA1890A9A80010ED21 /* WebKitTestRunnerApp-Info.plist */,
Expand Down Expand Up @@ -1075,10 +1037,8 @@
2EE52CDD1890A9A80010ED21 /* Frameworks */,
2EE52CDE1890A9A80010ED21 /* Resources */,
CEC209031D36E36A00261596 /* Copy Plug-Ins */,
E372BC342C08E22D006DFE67 /* Embed Extensions */,
);
buildRules = (
E372BC2C2C08C74A006DFE67 /* PBXBuildRule */,
);
dependencies = (
A18510361B9ADE6D00744AEB /* PBXTargetDependency */,
Expand Down

0 comments on commit 355516c

Please sign in to comment.