Title: [291821] trunk/Source/WebKit
Revision
291821
Author
pvol...@apple.com
Date
2022-03-24 16:14:15 -0700 (Thu, 24 Mar 2022)

Log Message

REGRESSION(r286590): Links with URL schemes are not clickable in Mail
https://bugs.webkit.org/show_bug.cgi?id=238262
<rdar://89145552>

Reviewed by Geoffrey Garen.

This feature requires access to the Launch Services daemon in Mail and other apps on iOS.
This patch is a partial revert of r286590.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::nonBrowserServices):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (291820 => 291821)


--- trunk/Source/WebKit/ChangeLog	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/ChangeLog	2022-03-24 23:14:15 UTC (rev 291821)
@@ -1,3 +1,25 @@
+2022-03-24  Per Arne Vollan  <pvol...@apple.com>
+
+        REGRESSION(r286590): Links with URL schemes are not clickable in Mail
+        https://bugs.webkit.org/show_bug.cgi?id=238262
+        <rdar://89145552>
+
+        Reviewed by Geoffrey Garen.
+
+        This feature requires access to the Launch Services daemon in Mail and other apps on iOS.
+        This patch is a partial revert of r286590.
+
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in:
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::nonBrowserServices):
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2022-03-24  Brent Fulgham  <bfulg...@apple.com>
 
         Disable RTCRtpScriptTransform in CaptivePortal mode

Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in (291820 => 291821)


--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in	2022-03-24 23:14:15 UTC (rev 291821)
@@ -1109,6 +1109,7 @@
         (extension "com.apple.webkit.extension.mach")
         (global-name
             "com.apple.iconservices"
+            "com.apple.lsd.open"
         )
     )
 )

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (291820 => 291821)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2022-03-24 23:14:15 UTC (rev 291821)
@@ -172,6 +172,7 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY)
+    encoder << dynamicMachExtensionHandles;
     encoder << dynamicIOKitExtensionHandles;
 #endif
 
@@ -481,6 +482,12 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY)
+    std::optional<Vector<SandboxExtension::Handle>> dynamicMachExtensionHandles;
+    decoder >> dynamicMachExtensionHandles;
+    if (!dynamicMachExtensionHandles)
+        return false;
+    parameters.dynamicMachExtensionHandles = WTFMove(*dynamicMachExtensionHandles);
+
     std::optional<Vector<SandboxExtension::Handle>> dynamicIOKitExtensionHandles;
     decoder >> dynamicIOKitExtensionHandles;
     if (!dynamicIOKitExtensionHandles)

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (291820 => 291821)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2022-03-24 23:14:15 UTC (rev 291821)
@@ -213,6 +213,7 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY)
+    Vector<SandboxExtension::Handle> dynamicMachExtensionHandles;
     Vector<SandboxExtension::Handle> dynamicIOKitExtensionHandles;
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (291820 => 291821)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2022-03-24 23:14:15 UTC (rev 291821)
@@ -291,6 +291,17 @@
 #endif
 }
 
+#if PLATFORM(IOS_FAMILY)
+static const Vector<ASCIILiteral>& nonBrowserServices()
+{
+    ASSERT(isMainRunLoop());
+    static NeverDestroyed services = Vector<ASCIILiteral> {
+        "com.apple.lsd.open"_s,
+    };
+    return services;
+}
+#endif
+
 void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process, WebProcessCreationParameters& parameters)
 {
     parameters.mediaMIMETypes = process.mediaMIMETypes();
@@ -407,6 +418,9 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY)
+    if (!isFullWebBrowser())
+        parameters.dynamicMachExtensionHandles = SandboxExtension::createHandlesForMachLookup(nonBrowserServices(), std::nullopt);
+
     if (WebCore::deviceHasAGXCompilerService())
         parameters.dynamicIOKitExtensionHandles = SandboxExtension::createHandlesForIOKitClassExtensions(WebCore::agxCompilerClasses(), std::nullopt);
 #endif

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (291820 => 291821)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2022-03-24 23:09:10 UTC (rev 291820)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2022-03-24 23:14:15 UTC (rev 291821)
@@ -426,6 +426,7 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY)
+    SandboxExtension::consumePermanently(parameters.dynamicMachExtensionHandles);
     SandboxExtension::consumePermanently(parameters.dynamicIOKitExtensionHandles);
 #endif
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to