Title: [260820] trunk
Revision
260820
Author
[email protected]
Date
2020-04-28 06:09:22 -0700 (Tue, 28 Apr 2020)

Log Message

[iOS] Fix sandbox violation when uploading a file
https://bugs.webkit.org/show_bug.cgi?id=210937

Reviewed by Darin Adler.

Source/WebKit:

On iOS, the file chooser needs access to frontboard and icon services in the WebContent process. Create and
consume extensions for these services when choosing files. When done, the extensions should be revoked. This
patch also fixes an out-of-bounds array exception when running the test created for this patch. Additionally,
the function thumbnailSizedImageForImage should return a RetainPtr<UIImage>, since it seems unsafe to not
retain the UIImage after the image context is released in that function.

Test: fast/forms/file/open-file-panel-crash.html

* Shared/ios/WebIconUtilities.h:
* Shared/ios/WebIconUtilities.mm:
(WebKit::thumbnailSizedImageForImage):
(WebKit::fallbackIconForFile):
(WebKit::iconForImageFile):
(WebKit::iconForVideoFile):
(WebKit::iconForFile):
* UIProcess/WebPageProxy.cpp:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[_WKFileUploadItem displayImage]):
(-[_WKImageFileUploadItem displayImage]):
(-[_WKVideoFileUploadItem displayImage]):
(-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
(-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
(-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::createIconForFiles):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

LayoutTests:

* fast/forms/file/open-file-panel-crash-expected.txt: Added.
* fast/forms/file/open-file-panel-crash.html: Added.
* platform/win/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (260819 => 260820)


--- trunk/LayoutTests/ChangeLog	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/LayoutTests/ChangeLog	2020-04-28 13:09:22 UTC (rev 260820)
@@ -1,3 +1,14 @@
+2020-04-28  Per Arne Vollan  <[email protected]>
+
+        [iOS] Fix sandbox violation when uploading a file
+        https://bugs.webkit.org/show_bug.cgi?id=210937
+
+        Reviewed by Darin Adler.
+
+        * fast/forms/file/open-file-panel-crash-expected.txt: Added.
+        * fast/forms/file/open-file-panel-crash.html: Added.
+        * platform/win/TestExpectations:
+
 2020-04-28  Youenn Fablet  <[email protected]>
 
         RTCPeerConnection should not remove its created remote MediaStream objects until getting close

Added: trunk/LayoutTests/fast/forms/file/open-file-panel-crash-expected.txt (0 => 260820)


--- trunk/LayoutTests/fast/forms/file/open-file-panel-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/file/open-file-panel-crash-expected.txt	2020-04-28 13:09:22 UTC (rev 260820)
@@ -0,0 +1,4 @@
+OPEN FILE PANEL
+Test that opening the file panel does not crash.
+
+

Added: trunk/LayoutTests/fast/forms/file/open-file-panel-crash.html (0 => 260820)


--- trunk/LayoutTests/fast/forms/file/open-file-panel-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/file/open-file-panel-crash.html	2020-04-28 13:09:22 UTC (rev 260820)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src=""
+<body>
+<p>Test that opening the file panel does not crash.</p>
+<input id=file1 type=file multiple=multiple>
+</form>
+<script>
+function openFilesInElement(element, files, icon) {
+    testRunner.setOpenPanelFiles(files);
+    if (testRunner.setOpenPanelFilesMediaIcon)
+        testRunner.setOpenPanelFilesMediaIcon(icon);
+    var centerX = element.offsetLeft + element.offsetWidth / 2;
+    var centerY = element.offsetTop + element.offsetHeight / 2;
+    UIHelper.activateAt(centerX, centerY);
+}
+
+function handleChange() {
+    testRunner.notifyDone();
+}
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+var file1 = document.getElementById('file1');
+file1.addEventListener('change', handleChange);
+// Icon is configured manually to avoid ObjC calls from C++ code
+var iconBytes = new Uint8Array([255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 96, 0, 96, 0, 0, 255, 219, 0, 67, 0, 8, 6, 6, 7, 6, 5, 8, 7, 7, 7, 9, 9, 8, 10, 12, 20, 13, 12, 11, 11, 12, 25, 18, 19, 15, 20, 29, 26, 31, 30, 29, 26, 28, 28, 32, 36, 46, 39, 32, 34, 44, 35, 28, 28, 40, 55, 41, 44, 48, 49, 52, 52, 52, 31, 39, 57, 61, 56, 50, 60, 46, 51, 52, 50, 255, 219, 0, 67, 1, 9, 9, 9, 12, 11, 12, 24, 13, 13, 24, 50, 33, 28, 33, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 255, 192, 0, 17, 8, 0, 1, 0, 1, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1, 255, 196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125, 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21
 , 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 255, 196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119, 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 3
 9, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0, 247, 250, 40, 162, 128, 63, 255, 217]);
+openFilesInElement(file1, ['foo.txt', 'bar.txt'], iconBytes);
+</script>
+</body>

Modified: trunk/LayoutTests/platform/win/TestExpectations (260819 => 260820)


--- trunk/LayoutTests/platform/win/TestExpectations	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/LayoutTests/platform/win/TestExpectations	2020-04-28 13:09:22 UTC (rev 260820)
@@ -4489,3 +4489,4 @@
 
 fast/text/combining-character-sequence-vertical.html [ Failure ]
 
+fast/forms/file/open-file-panel-crash.html [ Skip ]

Modified: trunk/Source/WebKit/ChangeLog (260819 => 260820)


--- trunk/Source/WebKit/ChangeLog	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/ChangeLog	2020-04-28 13:09:22 UTC (rev 260820)
@@ -1,3 +1,40 @@
+2020-04-28  Per Arne Vollan  <[email protected]>
+
+        [iOS] Fix sandbox violation when uploading a file
+        https://bugs.webkit.org/show_bug.cgi?id=210937
+
+        Reviewed by Darin Adler.
+
+        On iOS, the file chooser needs access to frontboard and icon services in the WebContent process. Create and
+        consume extensions for these services when choosing files. When done, the extensions should be revoked. This
+        patch also fixes an out-of-bounds array exception when running the test created for this patch. Additionally,
+        the function thumbnailSizedImageForImage should return a RetainPtr<UIImage>, since it seems unsafe to not
+        retain the UIImage after the image context is released in that function.
+
+        Test: fast/forms/file/open-file-panel-crash.html
+
+        * Shared/ios/WebIconUtilities.h:
+        * Shared/ios/WebIconUtilities.mm:
+        (WebKit::thumbnailSizedImageForImage):
+        (WebKit::fallbackIconForFile):
+        (WebKit::iconForImageFile):
+        (WebKit::iconForVideoFile):
+        (WebKit::iconForFile):
+        * UIProcess/WebPageProxy.cpp:
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[_WKFileUploadItem displayImage]):
+        (-[_WKImageFileUploadItem displayImage]):
+        (-[_WKVideoFileUploadItem displayImage]):
+        (-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
+        (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
+        (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
+        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+        (WebKit::WebChromeClient::createIconForFiles):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2020-04-27  Carlos Garcia Campos  <[email protected]>
 
         [GTK4] Add support for motion events

Modified: trunk/Source/WebKit/Shared/ios/WebIconUtilities.h (260819 => 260820)


--- trunk/Source/WebKit/Shared/ios/WebIconUtilities.h	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/Shared/ios/WebIconUtilities.h	2020-04-28 13:09:22 UTC (rev 260820)
@@ -31,10 +31,10 @@
 
 namespace WebKit {
 
-UIImage *fallbackIconForFile(NSURL *file);
-UIImage *iconForImageFile(NSURL *file);
-UIImage *iconForVideoFile(NSURL *file);
-UIImage *iconForFile(NSURL *file);
+RetainPtr<UIImage> fallbackIconForFile(NSURL *file);
+RetainPtr<UIImage> iconForImageFile(NSURL *file);
+RetainPtr<UIImage> iconForVideoFile(NSURL *file);
+RetainPtr<UIImage> iconForFile(NSURL *file);
 
 }
 

Modified: trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm (260819 => 260820)


--- trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/Shared/ios/WebIconUtilities.mm	2020-04-28 13:09:22 UTC (rev 260820)
@@ -71,7 +71,7 @@
     return [UIImage imageWithCGImage:squareImage.get()];
 }
 
-static UIImage *thumbnailSizedImageForImage(CGImageRef image)
+static RetainPtr<UIImage> thumbnailSizedImageForImage(CGImageRef image)
 {
     UIImage *squaredImage = squareImage(image);
     if (!squaredImage)
@@ -81,20 +81,22 @@
     UIGraphicsBeginImageContext(destRect.size);
     CGContextSetInterpolationQuality(UIGraphicsGetCurrentContext(), kCGInterpolationHigh);
     [squaredImage drawInRect:destRect];
-    UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
+    RetainPtr<UIImage> resultImage = UIGraphicsGetImageFromCurrentImageContext();
     UIGraphicsEndImageContext();
     return resultImage;
 }
 
-UIImage* fallbackIconForFile(NSURL *file)
+RetainPtr<UIImage> fallbackIconForFile(NSURL *file)
 {
     ASSERT_ARG(file, [file isFileURL]);
 
     UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL:file];
+    if (![interactionController.icons count])
+        return nil;
     return thumbnailSizedImageForImage(interactionController.icons[0].CGImage);
 }
 
-UIImage* iconForImageFile(NSURL *file)
+RetainPtr<UIImage> iconForImageFile(NSURL *file)
 {
     ASSERT_ARG(file, [file isFileURL]);
 
@@ -113,7 +115,7 @@
     return thumbnailSizedImageForImage(thumbnail.get());
 }
 
-UIImage* iconForVideoFile(NSURL *file)
+RetainPtr<UIImage> iconForVideoFile(NSURL *file)
 {
     ASSERT_ARG(file, [file isFileURL]);
 
@@ -131,7 +133,7 @@
     return thumbnailSizedImageForImage(imageRef.get());
 }
 
-UIImage* iconForFile(NSURL *file)
+RetainPtr<UIImage> iconForFile(NSURL *file)
 {
     ASSERT_ARG(file, [file isFileURL]);
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (260819 => 260820)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-28 13:09:22 UTC (rev 260820)
@@ -6640,8 +6640,12 @@
     send(Messages::WebPage::ExtendSandboxForFilesFromOpenPanel(sandboxExtensionHandles));
 #endif
 
-    send(Messages::WebPage::DidChooseFilesForOpenPanelWithDisplayStringAndIcon(fileURLs, displayString, iconData ? iconData->dataReference() : IPC::DataReference()));
+    SandboxExtension::Handle frontboardServicesSandboxExtension, iconServicesSandboxExtension;
+    SandboxExtension::createHandleForMachLookup("com.apple.frontboard.systemappservices", WTF::nullopt, frontboardServicesSandboxExtension);
+    SandboxExtension::createHandleForMachLookup("com.apple.iconservices", WTF::nullopt, iconServicesSandboxExtension);
 
+    send(Messages::WebPage::DidChooseFilesForOpenPanelWithDisplayStringAndIcon(fileURLs, displayString, iconData ? iconData->dataReference() : IPC::DataReference(), frontboardServicesSandboxExtension, iconServicesSandboxExtension));
+
     m_openPanelResultListener->invalidate();
     m_openPanelResultListener = nullptr;
 }

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (260819 => 260820)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2020-04-28 13:09:22 UTC (rev 260820)
@@ -74,7 +74,7 @@
 - (instancetype)initWithFileURL:(NSURL *)fileURL;
 @property (nonatomic, readonly, getter=isVideo) BOOL video;
 @property (nonatomic, readonly) NSURL *fileURL;
-@property (nonatomic, readonly) UIImage *displayImage;
+@property (nonatomic, readonly) RetainPtr<UIImage> displayImage;
 @end
 
 @implementation _WKFileUploadItem {
@@ -103,7 +103,7 @@
     return _fileURL.get();
 }
 
-- (UIImage *)displayImage
+- (RetainPtr<UIImage>)displayImage
 {
     ASSERT_NOT_REACHED();
     return nil;
@@ -122,7 +122,7 @@
     return NO;
 }
 
-- (UIImage *)displayImage
+- (RetainPtr<UIImage>)displayImage
 {
     return iconForImageFile(self.fileURL);
 }
@@ -140,7 +140,7 @@
     return YES;
 }
 
-- (UIImage *)displayImage
+- (RetainPtr<UIImage>)displayImage
 {
     return iconForVideoFile(self.fileURL);
 }
@@ -629,7 +629,7 @@
 {
     ASSERT(urls.count);
     [self _dismissDisplayAnimated:YES];
-    [self _chooseFiles:urls displayString:displayStringForDocumentsAtURLs(urls) iconImage:iconForFile(urls[0])];
+    [self _chooseFiles:urls displayString:displayStringForDocumentsAtURLs(urls) iconImage:iconForFile(urls[0]).get()];
 }
 
 - (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)documentPicker
@@ -667,7 +667,7 @@
             ASSERT([processedResults count] == 1);
             _WKFileUploadItem *result = [processedResults objectAtIndex:0];
             dispatch_async(dispatch_get_main_queue(), ^{
-                [self _chooseFiles:@[result.fileURL] displayString:displayString iconImage:result.displayImage];
+                [self _chooseFiles:@[result.fileURL] displayString:displayString iconImage:result.displayImage.get()];
             });
         }
         failureBlock:^{
@@ -684,7 +684,7 @@
 
     [self _processMediaInfoDictionaries:infos
         successBlock:^(NSArray *processedResults, NSString *displayString) {
-            UIImage *iconImage = nil;
+            RetainPtr<UIImage> iconImage = nil;
             NSMutableArray *fileURLs = [NSMutableArray array];
             for (_WKFileUploadItem *result in processedResults) {
                 NSURL *fileURL = result.fileURL;
@@ -696,7 +696,7 @@
             }
 
             dispatch_async(dispatch_get_main_queue(), ^{
-                [self _chooseFiles:fileURLs displayString:displayString iconImage:iconImage];
+                [self _chooseFiles:fileURLs displayString:displayString iconImage:iconImage.get()];
             });
         }
         failureBlock:^{

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (260819 => 260820)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2020-04-28 13:09:22 UTC (rev 260820)
@@ -151,7 +151,7 @@
 
     // FIXME: We should generate an icon showing multiple files here, if applicable. Currently, if there are multiple
     // files, we only use the first URL to generate an icon.
-    return Icon::createIconForImage(iconForFile([NSURL fileURLWithPath:filenames[0] isDirectory:NO]).CGImage);
+    return Icon::createIconForImage(iconForFile([NSURL fileURLWithPath:filenames[0] isDirectory:NO]).get().CGImage);
 }
 
 void WebChromeClient::associateEditableImageWithAttachment(GraphicsLayer::EmbeddedViewID embeddedViewID, const String& attachmentID)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (260819 => 260820)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-04-28 13:09:22 UTC (rev 260820)
@@ -271,6 +271,7 @@
 #include <WebCore/LegacyWebArchive.h>
 #include <WebCore/UTIRegistry.h>
 #include <wtf/MachSendRight.h>
+#include <wtf/spi/darwin/SandboxSPI.h>
 #endif
 
 #if HAVE(TOUCH_BAR)
@@ -4215,11 +4216,26 @@
 }
 
 #if PLATFORM(IOS_FAMILY)
-void WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>& files, const String& displayString, const IPC::DataReference& iconData)
+void WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>& files, const String& displayString, const IPC::DataReference& iconData, SandboxExtension::Handle&& frontboardServicesSandboxExtensionHandle, SandboxExtension::Handle&& iconServicesSandboxExtensionHandle)
 {
     if (!m_activeOpenPanelResultListener)
         return;
 
+    auto frontboardServicesSandboxExtension = SandboxExtension::create(WTFMove(frontboardServicesSandboxExtensionHandle));
+    if (frontboardServicesSandboxExtension) {
+        bool consumed = frontboardServicesSandboxExtension->consume();
+        ASSERT_UNUSED(consumed, consumed);
+    }
+
+    auto iconServicesSandboxExtension = SandboxExtension::create(WTFMove(iconServicesSandboxExtensionHandle));
+    if (iconServicesSandboxExtension) {
+        bool consumed = iconServicesSandboxExtension->consume();
+        ASSERT_UNUSED(consumed, consumed);
+    }
+
+    RELEASE_ASSERT(!sandbox_check(getpid(), "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.frontboard.systemappservices"));
+    RELEASE_ASSERT(!sandbox_check(getpid(), "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.frontboard.iconservices"));
+
     RefPtr<Icon> icon;
     if (!iconData.isEmpty()) {
         RetainPtr<CFDataRef> dataRef = adoptCF(CFDataCreate(nullptr, iconData.data(), iconData.size()));
@@ -4230,6 +4246,17 @@
 
     m_activeOpenPanelResultListener->didChooseFilesWithDisplayStringAndIcon(files, displayString, icon.get());
     m_activeOpenPanelResultListener = nullptr;
+
+    if (frontboardServicesSandboxExtension) {
+        bool revoked = frontboardServicesSandboxExtension->revoke();
+        ASSERT_UNUSED(revoked, revoked);
+    }
+
+    if (iconServicesSandboxExtension) {
+        bool revoked = iconServicesSandboxExtension->revoke();
+        ASSERT_UNUSED(revoked, revoked);
+    }
+
 }
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (260819 => 260820)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2020-04-28 13:09:22 UTC (rev 260820)
@@ -1584,7 +1584,7 @@
     void didCancelForOpenPanel();
 
 #if PLATFORM(IOS_FAMILY)
-    void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
+    void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData, WebKit::SandboxExtension::Handle&&, WebKit::SandboxExtension::Handle&&);
     bool isTransparentOrFullyClipped(const WebCore::Element&) const;
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (260819 => 260820)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2020-04-28 12:27:50 UTC (rev 260819)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2020-04-28 13:09:22 UTC (rev 260820)
@@ -338,7 +338,7 @@
 
     # Open panel.
 #if PLATFORM(IOS_FAMILY)
-    DidChooseFilesForOpenPanelWithDisplayStringAndIcon(Vector<String> fileURLs, String displayString, IPC::DataReference iconData)
+    DidChooseFilesForOpenPanelWithDisplayStringAndIcon(Vector<String> fileURLs, String displayString, IPC::DataReference iconData, WebKit::SandboxExtension::Handle frontboardServicesSandboxExtension, WebKit::SandboxExtension::Handle iconServicesSandboxExtension)
 #endif
     DidChooseFilesForOpenPanel(Vector<String> fileURLs)
     DidCancelForOpenPanel()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to