Title: [292756] trunk/Source/WebKit
Revision
292756
Author
wenson_hs...@apple.com
Date
2022-04-11 18:58:28 -0700 (Mon, 11 Apr 2022)

Log Message

REGRESSION: Web content process crashes when triggering Live Text in recoveryOS
https://bugs.webkit.org/show_bug.cgi?id=239096
rdar://91592943

Reviewed by Tim Horton.

Make encoding or decoding `RetainPtr<VKCImageAnalysis>` a no-op when the VisionKitCore framework is unavailable
on Cocoa platforms, rather than crashing (due to `PAL::getVKCImageAnalysisClass()` returning nil).

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<RetainPtr<VKCImageAnalysis>>::encode):
(IPC::ArgumentCoder<RetainPtr<VKCImageAnalysis>>::decode):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (292755 => 292756)


--- trunk/Source/WebKit/ChangeLog	2022-04-12 01:38:37 UTC (rev 292755)
+++ trunk/Source/WebKit/ChangeLog	2022-04-12 01:58:28 UTC (rev 292756)
@@ -1,3 +1,18 @@
+2022-04-11  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        REGRESSION: Web content process crashes when triggering Live Text in recoveryOS
+        https://bugs.webkit.org/show_bug.cgi?id=239096
+        rdar://91592943
+
+        Reviewed by Tim Horton.
+
+        Make encoding or decoding `RetainPtr<VKCImageAnalysis>` a no-op when the VisionKitCore framework is unavailable
+        on Cocoa platforms, rather than crashing (due to `PAL::getVKCImageAnalysisClass()` returning nil).
+
+        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
+        (IPC::ArgumentCoder<RetainPtr<VKCImageAnalysis>>::encode):
+        (IPC::ArgumentCoder<RetainPtr<VKCImageAnalysis>>::decode):
+
 2022-04-11  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WebGPU] Hook up device.queue to the IDL

Modified: trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (292755 => 292756)


--- trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm	2022-04-12 01:38:37 UTC (rev 292755)
+++ trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm	2022-04-12 01:58:28 UTC (rev 292756)
@@ -736,11 +736,17 @@
 
 void ArgumentCoder<RetainPtr<VKCImageAnalysis>>::encode(Encoder& encoder, const RetainPtr<VKCImageAnalysis>& data)
 {
+    if (!PAL::isVisionKitCoreFrameworkAvailable())
+        return;
+
     encoder << data.get();
 }
 
 std::optional<RetainPtr<VKCImageAnalysis>> ArgumentCoder<RetainPtr<VKCImageAnalysis>>::decode(Decoder& decoder)
 {
+    if (!PAL::isVisionKitCoreFrameworkAvailable())
+        return nil;
+
     return IPC::decode<VKCImageAnalysis>(decoder, @[ PAL::getVKCImageAnalysisClass() ]);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to