WebKit Bugzilla
Attachment 348205 Details for
Bug 189004
: [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189004-20180827145542.patch (text/plain), 34.09 KB, created by
Wenson Hsieh
on 2018-08-27 14:55:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-08-27 14:55:43 PDT
Size:
34.09 KB
patch
obsolete
>Subversion Revision: 235392 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 280f471e2a2c8d17ee4bf43e563348bdb875227e..9da0f408c156166216b6f7d206a8e01a3712a9e8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends >+ https://bugs.webkit.org/show_bug.cgi?id=189004 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, since there is no change in behavior. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * editing/Editor.cpp: >+ (WebCore::Editor::insertAttachment): >+ * editing/Editor.h: >+ * html/AttachmentTypes.h: Removed. >+ * html/HTMLAttachmentElement.h: >+ > 2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> > > [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b0933664def1faf18c03121a6bb82384fcaa212e..b51fa392f0c469399a6874371d8cb8fc17fd21f0 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,46 @@ >+2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends >+ https://bugs.webkit.org/show_bug.cgi?id=189004 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Removes all usage of WebCore::AttachmentDisplayOptions, and deletes an SPI method that isn't being used by any >+ internal clients. Removal of _WKAttachmentDisplayOptions itself is still blocked on the submission of >+ <rdar://problem/43357281>. >+ >+ * Scripts/webkit/messages.py: >+ * Shared/WebCoreArgumentCoders.cpp: >+ * UIProcess/API/APIAttachment.cpp: >+ (API::Attachment::setDisplayOptions): Deleted. >+ * UIProcess/API/APIAttachment.h: >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): >+ (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): >+ (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): >+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: >+ >+ Deprecate -_insertAttachmentWithFileWrapper:contentType:options:completion:, in favor of >+ -_insertAttachmentWithFileWrapper:contentType:completion:. >+ >+ * UIProcess/API/Cocoa/_WKAttachment.h: >+ >+ Remove -setDisplayOptions:completion:, since it is a now a noop, and also isn't used by any internal clients. >+ >+ * UIProcess/API/Cocoa/_WKAttachment.mm: >+ (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Deleted. >+ (-[_WKAttachment setDisplayOptions:completion:]): Deleted. >+ * UIProcess/API/Cocoa/_WKAttachmentInternal.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::insertAttachment): >+ (WebKit::WebPageProxy::setAttachmentDisplayOptions): Deleted. >+ * UIProcess/WebPageProxy.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::insertAttachment): >+ (WebKit::WebPage::setAttachmentDisplayOptions): Deleted. >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ > 2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> > > [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 7255d265c77215ec09ba38d967ca4cd7e8aa1658..b6df748a6d190485b18c3d58cb5183bbadb82f89 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -4806,7 +4806,6 @@ > F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */ = {isa = PBXBuildFile; fileRef = F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */; }; > F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; }; > F433E9031DBBDBA200EF0D14 /* StaticPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- F43759B41FCF48FA00100706 /* AttachmentTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = F43759B31FCF48FA00100706 /* AttachmentTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; > F44A5F591FED38F2007F5944 /* LegacyNSPasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = F44A5F571FED3830007F5944 /* LegacyNSPasteboardTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; > F44EBBD91DB5D21400277334 /* StaticRange.h in Headers */ = {isa = PBXBuildFile; fileRef = F44EBBD81DB5D21400277334 /* StaticRange.h */; settings = {ATTRIBUTES = (Private, ); }; }; > F45C231E1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F45C231C1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -14458,7 +14457,6 @@ > F3D461471161D53200CA0D09 /* JSErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorHandler.h; sourceTree = "<group>"; }; > F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPasteboard.h; sourceTree = "<group>"; }; > F433E9041DBBDBC200EF0D14 /* StaticPasteboard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaticPasteboard.cpp; sourceTree = "<group>"; }; >- F43759B31FCF48FA00100706 /* AttachmentTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AttachmentTypes.h; sourceTree = "<group>"; }; > F44A5F571FED3830007F5944 /* LegacyNSPasteboardTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyNSPasteboardTypes.h; sourceTree = "<group>"; }; > F44EBBD61DB5D1B600277334 /* StaticRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StaticRange.idl; sourceTree = "<group>"; }; > F44EBBD81DB5D21400277334 /* StaticRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticRange.h; sourceTree = "<group>"; }; >@@ -15240,8 +15238,8 @@ > 41103AA71E39790A00769F14 /* RealtimeOutgoingAudioSourceCocoa.cpp */, > 41103AA81E39790A00769F14 /* RealtimeOutgoingAudioSourceCocoa.h */, > 5CDD833B1E4324BB00621B83 /* RealtimeOutgoingVideoSourceCocoa.cpp */, >- 419242472127B7CC00634FCF /* RealtimeOutgoingVideoSourceCocoa.mm */, > 5CDD833C1E4324BB00621B83 /* RealtimeOutgoingVideoSourceCocoa.h */, >+ 419242472127B7CC00634FCF /* RealtimeOutgoingVideoSourceCocoa.mm */, > 070A9F5E1FFECC70003DF649 /* ScreenDisplayCaptureSourceMac.h */, > 070A9F601FFECC71003DF649 /* ScreenDisplayCaptureSourceMac.mm */, > 07D6373E1BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h */, >@@ -20284,7 +20282,6 @@ > 97C1F5511228558800EDE616 /* parser */, > 4150F9ED12B6E0990008C860 /* shadow */, > B1AD4E7713A12A7200846B27 /* track */, >- F43759B31FCF48FA00100706 /* AttachmentTypes.h */, > A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */, > A501920C132EBF2E008BFE55 /* Autocapitalize.h */, > A5A7AA42132F0ECC00D3A3C2 /* AutocapitalizeTypes.h */, >@@ -27037,7 +27034,6 @@ > FD5686CA13AC180200B69C68 /* AsyncAudioDecoder.h in Headers */, > E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */, > 0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */, >- F43759B41FCF48FA00100706 /* AttachmentTypes.h in Headers */, > A8C4A80D09D563270003AC8D /* Attr.h in Headers */, > A8C4A80B09D563270003AC8D /* Attribute.h in Headers */, > E4A814DA1C70E10D00BF85AC /* AttributeChangeInvalidation.h in Headers */, >@@ -31446,6 +31442,7 @@ > AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */, > CDA29A301CBF74D400901CCF /* PlaybackSessionInterfaceAVKit.mm in Sources */, > CDA29A161CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm in Sources */, >+ 419242492127B93E00634FCF /* RealtimeOutgoingVideoSourceCocoa.mm in Sources */, > 316DCB8A1E7A6996001B5F87 /* RTCIceTransport.cpp in Sources */, > BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */, > BCEF869F0E844E9D00A85CD5 /* ScrollbarThemeMac.mm in Sources */, >@@ -31566,7 +31563,6 @@ > 538EC8A11F993F9D004D22A8 /* UnifiedSource48.cpp in Sources */, > DE5F85991FA1ABF4006DB63A /* UnifiedSource49-mm.mm in Sources */, > 538EC8A21F993F9D004D22A8 /* UnifiedSource49.cpp in Sources */, >- 419242492127B93E00634FCF /* RealtimeOutgoingVideoSourceCocoa.mm in Sources */, > DE5F859A1FA1ABF4006DB63A /* UnifiedSource50-mm.mm in Sources */, > 538EC8A31F993F9D004D22A8 /* UnifiedSource50.cpp in Sources */, > DE5F86501FA2AF24006DB63A /* UnifiedSource51-mm.mm in Sources */, >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 4eca9150d6a7990dec2741ca36d4c68a9f57567a..438737a5273c889af802c2f33eda20ea6890cf39 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -3876,7 +3876,7 @@ void Editor::notifyClientOfAttachmentUpdates() > } > } > >-void Editor::insertAttachment(const String& identifier, const AttachmentDisplayOptions&, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType) >+void Editor::insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType) > { > auto attachment = HTMLAttachmentElement::create(HTMLNames::attachmentTag, document()); > attachment->setUniqueIdentifier(identifier); >diff --git a/Source/WebCore/editing/Editor.h b/Source/WebCore/editing/Editor.h >index 6f5abbac2da99699e7a52e500bded4bfe46d1280..3d63ce14511745b94904df98039dff8e61d7c784 100644 >--- a/Source/WebCore/editing/Editor.h >+++ b/Source/WebCore/editing/Editor.h >@@ -95,7 +95,6 @@ enum class MailBlockquoteHandling { > > #if ENABLE(ATTACHMENT_ELEMENT) > class HTMLAttachmentElement; >-struct AttachmentDisplayOptions; > #endif > > enum TemporarySelectionOption : uint8_t { >@@ -503,7 +502,7 @@ public: > bool isGettingDictionaryPopupInfo() const { return m_isGettingDictionaryPopupInfo; } > > #if ENABLE(ATTACHMENT_ELEMENT) >- WEBCORE_EXPORT void insertAttachment(const String& identifier, const AttachmentDisplayOptions&, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType); >+ WEBCORE_EXPORT void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType); > void registerAttachmentIdentifier(const String&, const String& /* contentType */, const String& /* preferredFileName */, Ref<SharedBuffer>&&); > void registerAttachmentIdentifier(const String&, const String& /* contentType */, const String& /* filePath */); > void cloneAttachmentData(const String& fromIdentifier, const String& toIdentifier); >diff --git a/Source/WebCore/html/AttachmentTypes.h b/Source/WebCore/html/AttachmentTypes.h >deleted file mode 100644 >index 89bbcabae8f3412a7ee592bd66b09ae88ce24304..0000000000000000000000000000000000000000 >--- a/Source/WebCore/html/AttachmentTypes.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#if ENABLE(ATTACHMENT_ELEMENT) >- >-#include <wtf/Optional.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-struct AttachmentDisplayOptions { >- template<class Encoder> void encode(Encoder&) const; >- template<class Decoder> static std::optional<AttachmentDisplayOptions> decode(Decoder&); >-}; >- >-template<class Encoder> inline void AttachmentDisplayOptions::encode(Encoder& encoder) const >-{ >- UNUSED_PARAM(encoder); >-} >- >-template<class Decoder> inline std::optional<AttachmentDisplayOptions> AttachmentDisplayOptions::decode(Decoder& decoder) >-{ >- UNUSED_PARAM(decoder); >- return AttachmentDisplayOptions(); >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(ATTACHMENT_ELEMENT) >diff --git a/Source/WebCore/html/HTMLAttachmentElement.h b/Source/WebCore/html/HTMLAttachmentElement.h >index 61ea15a928f0baa452e9dffe179acf4eed32762d..bf9443c6bfe8881302bf4ad0d9c64a3ed913da89 100644 >--- a/Source/WebCore/html/HTMLAttachmentElement.h >+++ b/Source/WebCore/html/HTMLAttachmentElement.h >@@ -27,7 +27,6 @@ > > #if ENABLE(ATTACHMENT_ELEMENT) > >-#include "AttachmentTypes.h" > #include "HTMLElement.h" > > namespace WebCore { >diff --git a/Source/WebKit/Scripts/webkit/messages.py b/Source/WebKit/Scripts/webkit/messages.py >index 7af168c93419cb329452060a410c8703ea10a359..06bea1cc2f0bd6626a09800812edd2671da8d608 100644 >--- a/Source/WebKit/Scripts/webkit/messages.py >+++ b/Source/WebKit/Scripts/webkit/messages.py >@@ -377,7 +377,6 @@ def headers_for_type(type): > 'WallTime': ['<wtf/WallTime.h>'], > 'String': ['<wtf/text/WTFString.h>'], > 'PAL::SessionID': ['<pal/SessionID.h>'], >- 'WebCore::AttachmentDisplayOptions': ['<WebCore/AttachmentTypes.h>'], > 'WebCore::AutoplayEventFlags': ['<WebCore/AutoplayEvent.h>'], > 'WebCore::ExceptionDetails': ['<WebCore/JSDOMExceptionHandling.h>'], > 'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'], >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 353d328542fb8ea91b6393da771be8565ba2e940..f44438f54409181ca0e205cba6c6b5be7181d16c 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -28,7 +28,6 @@ > > #include "DataReference.h" > #include "ShareableBitmap.h" >-#include <WebCore/AttachmentTypes.h> > #include <WebCore/AuthenticationChallenge.h> > #include <WebCore/BlobPart.h> > #include <WebCore/CacheQueryOptions.h> >diff --git a/Source/WebKit/UIProcess/API/APIAttachment.cpp b/Source/WebKit/UIProcess/API/APIAttachment.cpp >index 073a44ce4486cafd62e25cbde8e9fbc93bcc7f46..64106c67580a43baa2c2cedf2795dbdbe379fc2d 100644 >--- a/Source/WebKit/UIProcess/API/APIAttachment.cpp >+++ b/Source/WebKit/UIProcess/API/APIAttachment.cpp >@@ -28,7 +28,6 @@ > > #if ENABLE(ATTACHMENT_ELEMENT) > >-#include <WebCore/AttachmentTypes.h> > #include <WebCore/SharedBuffer.h> > #include <wtf/text/WTFString.h> > >@@ -49,14 +48,6 @@ Attachment::~Attachment() > { > } > >-void Attachment::setDisplayOptions(WebCore::AttachmentDisplayOptions options, Function<void(WebKit::CallbackBase::Error)>&& callback) >-{ >- if (m_webPage) >- m_webPage->setAttachmentDisplayOptions(m_identifier, options, WTFMove(callback)); >- else >- callback(WebKit::CallbackBase::Error::OwnerWasInvalidated); >-} >- > void Attachment::updateAttributes(Function<void(WebKit::CallbackBase::Error)>&& callback) > { > if (!m_webPage) { >diff --git a/Source/WebKit/UIProcess/API/APIAttachment.h b/Source/WebKit/UIProcess/API/APIAttachment.h >index 8443f430bc9363b93b08a37a343210f0bcc2dfc4..952f41b264817f33e2a76bbc89d9763266a17d5e 100644 >--- a/Source/WebKit/UIProcess/API/APIAttachment.h >+++ b/Source/WebKit/UIProcess/API/APIAttachment.h >@@ -38,7 +38,6 @@ OBJC_CLASS NSFileWrapper; > > namespace WebCore { > class SharedBuffer; >-struct AttachmentDisplayOptions; > } > > namespace WebKit { >@@ -55,7 +54,6 @@ public: > enum class InsertionState : uint8_t { NotInserted, Inserted }; > > const WTF::String& identifier() const { return m_identifier; } >- void setDisplayOptions(WebCore::AttachmentDisplayOptions, Function<void(WebKit::CallbackBase::Error)>&&); > void updateAttributes(Function<void(WebKit::CallbackBase::Error)>&&); > > void invalidate(); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 2fa783ffea2a531a952b1c346455be12910212da..69ee3d396f8c2645d54840a535fe9ebc2c5a3fa7 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -94,7 +94,6 @@ > #import "_WKSessionStateInternal.h" > #import "_WKVisitedLinkStoreInternal.h" > #import "_WKWebsitePoliciesInternal.h" >-#import <WebCore/AttachmentTypes.h> > #import <WebCore/GraphicsContextCG.h> > #import <WebCore/IOSurface.h> > #import <WebCore/JSDOMBinding.h> >@@ -4442,20 +4441,26 @@ WEBCORE_COMMAND(yankAndSelect) > > - (_WKAttachment *)_insertAttachmentWithFilename:(NSString *)filename contentType:(NSString *)contentType data:(NSData *)data options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler > { >+ UNUSED_PARAM(options); > auto fileWrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:data]); > if (filename) > [fileWrapper setPreferredFilename:filename]; >- return [self _insertAttachmentWithFileWrapper:fileWrapper.get() contentType:contentType options:options completion:completionHandler]; >+ return [self _insertAttachmentWithFileWrapper:fileWrapper.get() contentType:contentType completion:completionHandler]; > } > > - (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler >+{ >+ UNUSED_PARAM(options); >+ return [self _insertAttachmentWithFileWrapper:fileWrapper contentType:contentType completion:completionHandler]; >+} >+ >+- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void(^)(BOOL success))completionHandler > { > #if ENABLE(ATTACHMENT_ELEMENT) > auto identifier = createCanonicalUUIDString(); >- auto coreOptions = options ? options.coreDisplayOptions : WebCore::AttachmentDisplayOptions { }; > auto attachment = API::Attachment::create(identifier, *_page); > attachment->setFileWrapperAndUpdateContentType(fileWrapper, contentType); >- _page->insertAttachment(attachment.copyRef(), coreOptions, [capturedHandler = makeBlockPtr(completionHandler)] (WebKit::CallbackBase::Error error) { >+ _page->insertAttachment(attachment.copyRef(), [capturedHandler = makeBlockPtr(completionHandler)] (WebKit::CallbackBase::Error error) { > if (capturedHandler) > capturedHandler(error == WebKit::CallbackBase::Error::None); > }); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >index a3c5fa039f84c1c040d9f1886115c5415ef80af2..f050eb0e9d6a912ae87287c8f2edfe2d89ef417d 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >@@ -182,7 +182,8 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) { > @property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage WK_API_AVAILABLE(macosx(10.13.4), ios(8.0)); > > - (_WKAttachment *)_insertAttachmentWithFilename:(NSString *)filename contentType:(NSString *)contentType data:(NSData *)data options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:options:completion:", macosx(10.13.4, WK_MAC_TBA), ios(11.3, WK_IOS_TBA)); >-- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:completion:", macosx(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA)); >+- (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > #if TARGET_OS_IPHONE > // DERECATED: The setters of the three following function are deprecated, please use overrideLayoutParameters. >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm >index 0ca3d539386155c4aa40a49dc389457360b62e4b..811240d2842f50e7b924fd852a0f2b680fd153ce 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachment.mm >@@ -31,7 +31,6 @@ > #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> >@@ -46,12 +45,6 @@ static const NSInteger UnspecifiedAttachmentErrorCode = 1; > static const NSInteger InvalidAttachmentErrorCode = 2; > > @implementation _WKAttachmentDisplayOptions : NSObject >- >-- (WebCore::AttachmentDisplayOptions)coreDisplayOptions >-{ >- return { }; >-} >- > @end > > @implementation _WKAttachmentInfo { >@@ -131,25 +124,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()) { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >index 138a9537a8150c46f60a7afd03bcd19afe19b708..abda1528fb7c543460621491a731d17b42254bff 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >@@ -34,10 +34,6 @@ template<> struct WrapperTraits<API::Attachment> { > > } > >-@interface _WKAttachmentDisplayOptions () >-@property (nonatomic, readonly) WebCore::AttachmentDisplayOptions coreDisplayOptions; >-@end >- > @interface _WKAttachment () <WKObject> { > @package > API::ObjectStorage<API::Attachment> _attachment; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index fa8124c63675a8ac2ef8568b703f66ba3c34d598..d513337fd551c117a8b54464f532990d1b0d3f5a 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -122,7 +122,6 @@ > #include "WebURLSchemeHandler.h" > #include "WebUserContentControllerProxy.h" > #include "WebsiteDataStore.h" >-#include <WebCore/AttachmentTypes.h> > #include <WebCore/BitmapImage.h> > #include <WebCore/DeprecatedGlobalSettings.h> > #include <WebCore/DiagnosticLoggingClient.h> >@@ -7751,7 +7750,7 @@ RefPtr<API::Attachment> WebPageProxy::attachmentForIdentifier(const String& iden > return m_attachmentIdentifierToAttachmentMap.get(identifier); > } > >-void WebPageProxy::insertAttachment(Ref<API::Attachment>&& attachment, const AttachmentDisplayOptions& options, Function<void(CallbackBase::Error)>&& callback) >+void WebPageProxy::insertAttachment(Ref<API::Attachment>&& attachment, Function<void(CallbackBase::Error)>&& callback) > { > if (!isValid()) { > callback(CallbackBase::Error::OwnerWasInvalidated); >@@ -7760,21 +7759,10 @@ void WebPageProxy::insertAttachment(Ref<API::Attachment>&& attachment, const Att > > auto attachmentIdentifier = attachment->identifier(); > auto callbackID = m_callbacks.put(WTFMove(callback), m_process->throttler().backgroundActivityToken()); >- m_process->send(Messages::WebPage::InsertAttachment(attachmentIdentifier, options, attachment->fileSizeForDisplay(), attachment->fileName(), attachment->contentType(), callbackID), m_pageID); >+ m_process->send(Messages::WebPage::InsertAttachment(attachmentIdentifier, attachment->fileSizeForDisplay(), attachment->fileName(), attachment->contentType(), callbackID), m_pageID); > m_attachmentIdentifierToAttachmentMap.set(attachmentIdentifier, WTFMove(attachment)); > } > >-void WebPageProxy::setAttachmentDisplayOptions(const String& identifier, AttachmentDisplayOptions options, Function<void(CallbackBase::Error)>&& callback) >-{ >- if (!isValid()) { >- callback(CallbackBase::Error::OwnerWasInvalidated); >- return; >- } >- >- auto callbackID = m_callbacks.put(WTFMove(callback), m_process->throttler().backgroundActivityToken()); >- m_process->send(Messages::WebPage::SetAttachmentDisplayOptions(identifier, options, callbackID), m_pageID); >-} >- > void WebPageProxy::updateAttachmentAttributes(const API::Attachment& attachment, Function<void(CallbackBase::Error)>&& callback) > { > if (!isValid()) { >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 8c55d2558f8b6decd00a4c587219a400f1b0e9a1..25fe4a2e84cd849d3d9b0fa1cd9389a73dc1cea6 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -196,12 +196,6 @@ template <typename> class RectEdges; > using FloatBoxExtent = RectEdges<float>; > } > >-#if ENABLE(ATTACHMENT_ELEMENT) >-namespace WebCore { >-struct AttachmentDisplayOptions; >-} >-#endif >- > #if PLATFORM(GTK) > typedef GtkWidget* PlatformWidget; > #endif >@@ -1319,8 +1313,7 @@ public: > > #if ENABLE(ATTACHMENT_ELEMENT) > RefPtr<API::Attachment> attachmentForIdentifier(const String& identifier) const; >- void insertAttachment(Ref<API::Attachment>&&, const WebCore::AttachmentDisplayOptions&, Function<void(CallbackBase::Error)>&&); >- void setAttachmentDisplayOptions(const String& identifier, WebCore::AttachmentDisplayOptions, Function<void(CallbackBase::Error)>&&); >+ void insertAttachment(Ref<API::Attachment>&&, Function<void(CallbackBase::Error)>&&); > void updateAttachmentAttributes(const API::Attachment&, Function<void(CallbackBase::Error)>&&); > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 4b5f5ab8690efe69adcd1360e7c1988adf050ff5..32659971940120454f5239cb00183a59cf5d90ab 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -6066,15 +6066,10 @@ void WebPage::storageAccessResponse(bool wasGranted, uint64_t contextId) > > #if ENABLE(ATTACHMENT_ELEMENT) > >-void WebPage::insertAttachment(const String& identifier, const AttachmentDisplayOptions& options, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID callbackID) >+void WebPage::insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID callbackID) > { > auto& frame = m_page->focusController().focusedOrMainFrame(); >- frame.editor().insertAttachment(identifier, options, WTFMove(fileSize), fileName, contentType); >- send(Messages::WebPageProxy::VoidCallback(callbackID)); >-} >- >-void WebPage::setAttachmentDisplayOptions(const String&, const AttachmentDisplayOptions&, CallbackID callbackID) >-{ >+ frame.editor().insertAttachment(identifier, WTFMove(fileSize), fileName, contentType); > send(Messages::WebPageProxy::VoidCallback(callbackID)); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 4d4ae851b265ecb39e0f5eea40ae01069d440081..2559a0d65565145c56eefb48bafb9f3d5e608a92 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -172,11 +172,8 @@ struct PromisedAttachmentInfo; > struct TextCheckingResult; > struct ViewportArguments; > >- >- > #if ENABLE(ATTACHMENT_ELEMENT) > class HTMLAttachmentElement; >-struct AttachmentDisplayOptions; > #endif > } > >@@ -1075,8 +1072,7 @@ public: > #endif > > #if ENABLE(ATTACHMENT_ELEMENT) >- void insertAttachment(const String& identifier, const WebCore::AttachmentDisplayOptions&, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); >- void setAttachmentDisplayOptions(const String& identifier, const WebCore::AttachmentDisplayOptions&, CallbackID); >+ void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); > void updateAttachmentAttributes(const String& identifier, std::optional<uint64_t>&& fileSize, const String& contentType, std::optional<String>&& newFilename, CallbackID); > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 289abda87f053b4bac25bead05524647d974659f..7ddcb9b214bd9dd541947a94d2baf5a5e2537c9a 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -510,8 +510,7 @@ messages -> WebPage LegacyReceiver { > #endif > > #if ENABLE(ATTACHMENT_ELEMENT) >- InsertAttachment(String identifier, struct WebCore::AttachmentDisplayOptions options, std::optional<uint64_t> fileSize, String fileName, String contentType, WebKit::CallbackID callbackID) >- SetAttachmentDisplayOptions(String identifier, struct WebCore::AttachmentDisplayOptions options, WebKit::CallbackID callbackID) >+ InsertAttachment(String identifier, std::optional<uint64_t> fileSize, String fileName, String contentType, WebKit::CallbackID callbackID) > UpdateAttachmentAttributes(String identifier, std::optional<uint64_t> fileSize, String newContentType, std::optional<String> newFilename, WebKit::CallbackID callbackID) > #endif > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 6cb8d2b8c88532f8fba79fb6f7646d86aa48e6bd..383d8814fb0765b582f23ba6e1705aed864af61c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends >+ https://bugs.webkit.org/show_bug.cgi?id=189004 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move off of deprecated attachment insertion SPI. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: >+ (-[TestWKWebView synchronouslyInsertAttachmentWithFileWrapper:contentType:]): >+ (-[TestWKWebView synchronouslyInsertAttachmentWithFilename:contentType:data:]): >+ (-[_WKAttachment synchronouslySetDisplayOptions:error:]): Deleted. >+ > 2018-08-27 Wenson Hsieh <wenson_hsieh@apple.com> > > [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm >index 0a0103b4b382d3b4cc7b751fb250f8ed59788d3e..70d227057c734685269cf16724daa576d8bb08c9 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm >@@ -261,7 +261,7 @@ static NSData *testPDFData() > - (_WKAttachment *)synchronouslyInsertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType > { > __block bool done = false; >- RetainPtr<_WKAttachment> attachment = [self _insertAttachmentWithFileWrapper:fileWrapper contentType:contentType options:nil completion:^(BOOL) { >+ RetainPtr<_WKAttachment> attachment = [self _insertAttachmentWithFileWrapper:fileWrapper contentType:contentType completion:^(BOOL) { > done = true; > }]; > TestWebKitAPI::Util::run(&done); >@@ -274,7 +274,7 @@ static NSData *testPDFData() > auto fileWrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:data]); > if (filename) > [fileWrapper setPreferredFilename:filename]; >- RetainPtr<_WKAttachment> attachment = [self _insertAttachmentWithFileWrapper:fileWrapper.get() contentType:contentType options:nil completion:^(BOOL) { >+ RetainPtr<_WKAttachment> attachment = [self _insertAttachmentWithFileWrapper:fileWrapper.get() contentType:contentType completion:^(BOOL) { > done = true; > }]; > TestWebKitAPI::Util::run(&done); >@@ -343,21 +343,6 @@ static NSData *testPDFData() > > @implementation _WKAttachment (AttachmentTesting) > >-- (void)synchronouslySetDisplayOptions:(_WKAttachmentDisplayOptions *)options error:(NSError **)error >-{ >- __block RetainPtr<NSError> resultError; >- __block bool done = false; >- [self setDisplayOptions:options completion:^(NSError *error) { >- resultError = error; >- done = true; >- }]; >- >- TestWebKitAPI::Util::run(&done); >- >- if (error) >- *error = resultError.autorelease(); >-} >- > - (void)synchronouslySetFileWrapper:(NSFileWrapper *)fileWrapper newContentType:(NSString *)newContentType error:(NSError **)error > { > __block RetainPtr<NSError> resultError;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189004
:
348205
|
348210