Changeset 286527 in webkit
- Timestamp:
- Dec 4, 2021, 12:28:31 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm (modified) (4 diffs)
-
WebKit.xcodeproj/project.pbxproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r286522 r286527 1 2021-12-04 Brent Fulgham <bfulgham@apple.com> 2 3 [Cocoa] Launch Captive Portal WebContent process when requested 4 https://bugs.webkit.org/show_bug.cgi?id=233824 5 <rdar://problem/86023898> 6 7 Reviewed by Darin Adler. 8 9 When the WebKit client requests a Captive Portal process, launch the dedicated XPC service 10 with Captive Portal entitlements. 11 12 * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: 13 (WebKit::webContentServiceName): New helper function. 14 (WebKit::serviceName): Update to use new helper. 15 (WebKit::ProcessLauncher::launchProcess): Log errors when launching. 16 * WebKit.xcodeproj/project.pbxproj: Include the CaptivePortal xpc service when creating 17 development symlinks. 18 1 19 2021-12-03 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm
r285737 r286527 55 55 namespace WebKit { 56 56 57 static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptions) 57 static const char* webContentServiceName(bool nonValidInjectedCodeAllowed, ProcessLauncher::Client* client) 58 { 59 if (client && client->shouldEnableCaptivePortalMode()) 60 return "com.apple.WebKit.WebContent.CaptivePortal"; 61 62 return nonValidInjectedCodeAllowed ? "com.apple.WebKit.WebContent.Development" : "com.apple.WebKit.WebContent"; 63 } 64 65 static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher::Client* client) 58 66 { 59 67 switch (launchOptions.processType) { 60 68 case ProcessLauncher::ProcessType::Web: 61 return launchOptions.nonValidInjectedCodeAllowed ? "com.apple.WebKit.WebContent.Development" : "com.apple.WebKit.WebContent";69 return webContentServiceName(launchOptions.nonValidInjectedCodeAllowed, client); 62 70 case ProcessLauncher::ProcessType::Network: 63 71 return "com.apple.WebKit.Networking"; … … 121 129 name = m_launchOptions.customWebContentServiceBundleIdentifier.data(); 122 130 else 123 name = serviceName(m_launchOptions );131 name = serviceName(m_launchOptions, m_client); 124 132 125 133 m_xpcConnection = adoptOSObject(xpc_connection_create(name, nullptr)); … … 232 240 xpc_dictionary_set_value(bootstrapMessage.get(), "extra-initialization-data", extraInitializationData.get()); 233 241 234 auto errorHandlerImpl = [weakProcessLauncher = WeakPtr { *this }, listeningPort ] (xpc_object_t event) {242 auto errorHandlerImpl = [weakProcessLauncher = WeakPtr { *this }, listeningPort, name] (xpc_object_t event) { 235 243 ASSERT(!event || xpc_get_type(event) == XPC_TYPE_ERROR); 236 244 … … 241 249 if (!processLauncher->isLaunching()) 242 250 return; 251 252 #if ERROR_DISABLED 253 UNUSED_PARAM(name); 254 #endif 255 256 LOG_ERROR("Error while launching %s: %s", name, xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION)); 243 257 244 258 #if ASSERT_ENABLED -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r286508 r286527 14827 14827 runOnlyForDeploymentPostprocessing = 0; 14828 14828 shellPath = /bin/sh; 14829 shellScript = "if [[ \"${DEPLOYMENT_LOCATION}\" == \"YES\" ]]; then\n exit\nfi\n\nif [[ ${WK_PLATFORM_NAME} != \"macosx\" ]]; then\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/XPCServices\"\n BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES=\"../..\"\nelse\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/Versions/A/XPCServices\"\n BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES=\"../../../..\"\nfi\n\nmkdir -p \"${XPC_SERVICES_PATH}\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit. Networking.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.GPU.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.GPU.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.WebAuthn.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebAuthn.xpc\"\n\nif [[ ${WK_PLATFORM_NAME} == macosx ]]; then\n ln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.Plugin.64.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.64.xpc\"\nfi\n";14829 shellScript = "if [[ \"${DEPLOYMENT_LOCATION}\" == \"YES\" ]]; then\n exit\nfi\n\nif [[ ${WK_PLATFORM_NAME} != \"macosx\" ]]; then\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/XPCServices\"\n BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES=\"../..\"\nelse\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/Versions/A/XPCServices\"\n BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES=\"../../../..\"\nfi\n\nmkdir -p \"${XPC_SERVICES_PATH}\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.WebContent.CaptivePortal.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.CaptivePortal.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.Networking.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.GPU.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.GPU.xpc\"\nln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.WebAuthn.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebAuthn.xpc\"\n\nif [[ ${WK_PLATFORM_NAME} == macosx ]]; then\n ln -sFh \"${BUILT_PRODUCTS_DIR_RELATIVE_PATH_FROM_XPC_SERVICES}/com.apple.WebKit.Plugin.64.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.64.xpc\"\nfi\n"; 14830 14830 }; 14831 14831 942DB245257EE6DF009BD80A /* Create /usr/local to work around XBS Bug <rdar://problem/20388650> */ = {
Note:
See TracChangeset
for help on using the changeset viewer.