Unreviewed, rolling out r240630.
[WebKit-https.git] / Source / WebKit / UIProcess / API / Cocoa / _WKAttachment.mm
index 0ca3d53..ffffd22 100644 (file)
 #import "APIAttachment.h"
 #import "WKErrorPrivate.h"
 #import "_WKAttachmentInternal.h"
-#import <WebCore/AttachmentTypes.h>
 #import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/SharedBuffer.h>
 #import <wtf/BlockPtr.h>
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
 #import <MobileCoreServices/MobileCoreServices.h>
 #endif
 
-using namespace WebKit;
-
 static const NSInteger UnspecifiedAttachmentErrorCode = 1;
 static const NSInteger InvalidAttachmentErrorCode = 2;
 
 @implementation _WKAttachmentDisplayOptions : NSObject
-
-- (WebCore::AttachmentDisplayOptions)coreDisplayOptions
-{
-    return { };
-}
-
 @end
 
 @implementation _WKAttachmentInfo {
@@ -131,25 +122,6 @@ static const NSInteger InvalidAttachmentErrorCode = 2;
     completionHandler(self.info, nil);
 }
 
-- (void)setDisplayOptions:(_WKAttachmentDisplayOptions *)options completion:(void(^)(NSError *))completionHandler
-{
-    if (!_attachment->isValid()) {
-        completionHandler([NSError errorWithDomain:WKErrorDomain code:InvalidAttachmentErrorCode userInfo:nil]);
-        return;
-    }
-
-    auto coreOptions = options ? options.coreDisplayOptions : WebCore::AttachmentDisplayOptions { };
-    _attachment->setDisplayOptions(coreOptions, [capturedBlock = makeBlockPtr(completionHandler)] (CallbackBase::Error error) {
-        if (!capturedBlock)
-            return;
-
-        if (error == CallbackBase::Error::None)
-            capturedBlock(nil);
-        else
-            capturedBlock([NSError errorWithDomain:WKErrorDomain code:UnspecifiedAttachmentErrorCode userInfo:nil]);
-    });
-}
-
 - (void)setFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void (^)(NSError *))completionHandler
 {
     if (!_attachment->isValid()) {
@@ -165,7 +137,7 @@ static const NSInteger InvalidAttachmentErrorCode = 2;
         if (!capturedBlock)
             return;
 
-        if (error == CallbackBase::Error::None)
+        if (error == WebKit::CallbackBase::Error::None)
             capturedBlock(nil);
         else
             capturedBlock([NSError errorWithDomain:WKErrorDomain code:UnspecifiedAttachmentErrorCode userInfo:nil]);