Unreviewed, fix watchOS and tvOS builds after r251224
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 16:04:54 +0000 (16:04 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 16:04:54 +0000 (16:04 +0000)
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::shouldTreatAtLeastOneTypeAsFile):

Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

index 71c789f..fce52eb 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Unreviewed, fix watchOS and tvOS builds after r251224
+
+        * platform/ios/PlatformPasteboardIOS.mm:
+        (WebCore::shouldTreatAtLeastOneTypeAsFile):
+
+        Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
+        section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.
+
 2019-10-17  Youenn Fablet  <youenn@apple.com>
 
         MultiChannelResampler does not need to recreate a ChannelProvider for every process call
index b356525..8cb3b60 100644 (file)
@@ -95,6 +95,15 @@ int PlatformPasteboard::numberOfFiles() const
     return [m_pasteboard respondsToSelector:@selector(numberOfFiles)] ? [m_pasteboard numberOfFiles] : 0;
 }
 
+static bool shouldTreatAtLeastOneTypeAsFile(NSArray<NSString *> *platformTypes)
+{
+    for (NSString *type in platformTypes) {
+        if (Pasteboard::shouldTreatCocoaTypeAsFile(type))
+            return true;
+    }
+    return false;
+}
+
 #if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
 
 static const char *safeTypeForDOMToReadAndWriteForPlatformType(const String& platformType)
@@ -155,15 +164,6 @@ static PasteboardItemPresentationStyle pasteboardItemPresentationStyle(UIPreferr
 
 #endif // PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA
 
-static bool shouldTreatAtLeastOneTypeAsFile(NSArray <NSString *> *platformTypes)
-{
-    for (NSString *type in platformTypes) {
-        if (Pasteboard::shouldTreatCocoaTypeAsFile(type))
-            return true;
-    }
-    return false;
-}
-
 PasteboardItemInfo PlatformPasteboard::informationForItemAtIndex(size_t index)
 {
     if (index >= static_cast<NSUInteger>([m_pasteboard numberOfItems]))