Unreviewed, fix the tvOS build after r223340.
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Oct 2017 16:21:09 +0000 (16:21 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Oct 2017 16:21:09 +0000 (16:21 +0000)
Add a new #define in PlatformPasteboardIOS.mm for item provider support, and guard usages of
WebItemProviderPasteboard using it.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::pasteboardMayContainFilePaths):
(WebCore::PlatformPasteboard::readURL):

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

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

index 043d604..6c7d465 100644 (file)
@@ -1,3 +1,14 @@
+2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Unreviewed, fix the tvOS build after r223340.
+
+        Add a new #define in PlatformPasteboardIOS.mm for item provider support, and guard usages of
+        WebItemProviderPasteboard using it.
+
+        * platform/ios/PlatformPasteboardIOS.mm:
+        (WebCore::pasteboardMayContainFilePaths):
+        (WebCore::PlatformPasteboard::readURL):
+
 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r223271.
index c337719..a4e8bf9 100644 (file)
@@ -41,6 +41,8 @@
 #import <wtf/SoftLinking.h>
 #import <wtf/text/StringHash.h>
 
+#define PASTEBOARD_SUPPORTS_ITEM_PROVIDERS (PLATFORM(IOS) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV)))
+
 SOFT_LINK_FRAMEWORK(UIKit)
 SOFT_LINK_CLASS(UIKit, UIImage)
 SOFT_LINK_CLASS(UIKit, UIPasteboard)
@@ -52,7 +54,7 @@ PlatformPasteboard::PlatformPasteboard()
 {
 }
 
-#if PLATFORM(IOS) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV))
+#if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
 PlatformPasteboard::PlatformPasteboard(const String& name)
 {
     if (name == "data interaction pasteboard")
@@ -113,8 +115,10 @@ Vector<String> PlatformPasteboard::filenamesForDataInteraction()
 
 static bool pasteboardMayContainFilePaths(id<AbstractPasteboard> pasteboard)
 {
+#if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
     if ([pasteboard isKindOfClass:[WebItemProviderPasteboard class]])
         return false;
+#endif
 
     for (NSString *type in pasteboard.pasteboardTypes) {
         if (Pasteboard::shouldTreatCocoaTypeAsFile(type))
@@ -208,7 +212,7 @@ String PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite
     return { };
 }
 
-#if PLATFORM(IOS) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV))
+#if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
 
 static NSString *webIOSPastePboardType = @"iOS rich content paste pasteboard type";
 
@@ -578,7 +582,7 @@ URL PlatformPasteboard::readURL(int index, const String& type, String& title)
     if (!allowReadingURLAtIndex(url, index))
         return { };
 
-#if PLATFORM(IOS) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV))
+#if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS
     title = [url _title];
 #else
     UNUSED_PARAM(title);