Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareTo...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 22:32:43 +0000 (22:32 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 22:32:43 +0000 (22:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181497

Reviewed by Tim Horton.

Source/WebCore:

Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
change in behavior; promised blob dragging covered by WKAttachment API tests.

* loader/EmptyClients.cpp:
* page/DragClient.h:
(WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
(WebCore::DragController::promisedBlobInfo):
(WebCore::DragController::dragAttachmentElement): Deleted.
* page/DragController.h:
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):

Source/WebKit:

Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
codepath that stages promised blob info.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
* UIProcess/PageClient.h:
(WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startDrag:item:]):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/mac:

See other ChangeLogs for more detail.

* WebCoreSupport/WebDragClient.h:

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

26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/page/DragClient.h
Source/WebCore/page/DragController.cpp
Source/WebCore/page/DragController.h
Source/WebCore/platform/DragItem.h
Source/WebCore/platform/PromisedBlobInfo.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h

index d3c85c2..2b89931 100644 (file)
@@ -1,3 +1,27 @@
+2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
+        https://bugs.webkit.org/show_bug.cgi?id=181497
+
+        Reviewed by Tim Horton.
+
+        Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
+        change in behavior; promised blob dragging covered by WKAttachment API tests.
+
+        * loader/EmptyClients.cpp:
+        * page/DragClient.h:
+        (WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
+        * page/DragController.cpp:
+        (WebCore::DragController::startDrag):
+        (WebCore::DragController::doImageDrag):
+        (WebCore::DragController::doSystemDrag):
+        (WebCore::DragController::promisedBlobInfo):
+        (WebCore::DragController::dragAttachmentElement): Deleted.
+        * page/DragController.h:
+        * platform/DragItem.h:
+        (WebCore::DragItem::encode const):
+        (WebCore::DragItem::decode):
+
 2018-01-11  Youenn Fablet  <youenn@apple.com>
 
         RTCController should disable ICE candidate filtering in case of getUserMedia based on the RTCPerrConnection origin
index 15f2a40..f24ad6a 100644 (file)
@@ -134,7 +134,6 @@ class EmptyDragClient final : public DragClient {
     DragSourceAction dragSourceActionMaskForPoint(const IntPoint&) final { return DragSourceActionNone; }
     void startDrag(DragItem, DataTransfer&, Frame&) final { }
     void dragControllerDestroyed() final { }
-    void prepareToDragPromisedBlob(const PromisedBlobInfo&) final { }
 };
 
 #endif // ENABLE(DRAG_SUPPORT)
index 6ff546e..b74485d 100644 (file)
@@ -61,8 +61,6 @@ public:
     virtual void declareAndWriteDragImage(const String&, Element&, const URL&, const String&, Frame*) { }
 #endif
 
-    virtual void prepareToDragPromisedBlob(const PromisedBlobInfo&) { }
-
     virtual ~DragClient() = default;
 };
     
index 269d549..4eefbab 100644 (file)
@@ -983,7 +983,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
             return false;
 
         if (mustUseLegacyDragClient) {
-            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state);
+            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state, { });
             return true;
         }
 
@@ -1019,7 +1019,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
             doImageDrag(element, dragOrigin, hitTestResult.imageRect(), src, m_dragOffset, state);
         else {
             // DHTML defined drag image
-            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state);
+            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state, { });
         }
 
         return true;
@@ -1071,7 +1071,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
         }
 
         if (mustUseLegacyDragClient) {
-            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state);
+            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state, { });
             return true;
         }
 
@@ -1093,9 +1093,12 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
         src.editor().setIgnoreSelectionChanges(true);
         auto previousSelection = src.selection().selection();
         selectElement(element);
-        if (hasData == HasNonDefaultPasteboardData::No && !dragAttachmentElement(src, attachment)) {
+
+        PromisedBlobInfo promisedBlob;
+        if (hasData == HasNonDefaultPasteboardData::No) {
+            promisedBlob = promisedBlobInfo(src, attachment);
             auto& editor = src.editor();
-            if (editor.client()) {
+            if (!promisedBlob && editor.client()) {
 #if PLATFORM(COCOA)
                 // Otherwise, if no file URL is specified, call out to the injected bundle to populate the pasteboard with data.
                 editor.willWriteSelectionToPasteboard(src.selection().toNormalizedRange().get());
@@ -1119,7 +1122,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
             dragLoc = dragLocForSelectionDrag(src);
             m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y());
         }
-        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state);
+        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state, WTFMove(promisedBlob));
         if (!element.isContentRichlyEditable())
             src.selection().setSelection(previousSelection);
         src.editor().setIgnoreSelectionChanges(false);
@@ -1130,7 +1133,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
     if (state.type == DragSourceActionDHTML && dragImage) {
         ASSERT(m_dragSourceAction & DragSourceActionDHTML);
         m_client.willPerformDragSourceAction(DragSourceActionDHTML, dragOrigin, dataTransfer);
-        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state);
+        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, src, state, { });
         return true;
     }
 
@@ -1180,7 +1183,7 @@ void DragController::doImageDrag(Element& element, const IntPoint& dragOrigin, c
         return;
 
     dragImageOffset = mouseDownPoint + scaledOrigin;
-    doSystemDrag(WTFMove(dragImage), dragImageOffset, dragOrigin, frame, state);
+    doSystemDrag(WTFMove(dragImage), dragImageOffset, dragOrigin, frame, state, { });
 }
 
 void DragController::beginDrag(DragItem dragItem, Frame& frame, const IntPoint& mouseDownPoint, const IntPoint& mouseDraggedPoint, DataTransfer& dataTransfer, DragSourceAction dragSourceAction)
@@ -1207,7 +1210,7 @@ void DragController::beginDrag(DragItem dragItem, Frame& frame, const IntPoint&
     cleanupAfterSystemDrag();
 }
 
-void DragController::doSystemDrag(DragImage image, const IntPoint& dragLoc, const IntPoint& eventPos, Frame& frame, const DragState& state)
+void DragController::doSystemDrag(DragImage image, const IntPoint& dragLoc, const IntPoint& eventPos, Frame& frame, const DragState& state, PromisedBlobInfo&& promisedBlob)
 {
     m_didInitiateDrag = true;
     m_dragInitiator = frame.document();
@@ -1218,6 +1221,7 @@ void DragController::doSystemDrag(DragImage image, const IntPoint& dragLoc, cons
     DragItem item;
     item.image = WTFMove(image);
     item.sourceAction = state.type;
+    item.promisedBlob = WTFMove(promisedBlob);
 
     auto eventPositionInRootViewCoordinates = frame.view()->contentsToRootView(eventPos);
     auto dragLocationInRootViewCoordinates = frame.view()->contentsToRootView(dragLoc);
@@ -1304,10 +1308,10 @@ String DragController::platformContentTypeForBlobType(const String& type) const
 
 #if ENABLE(ATTACHMENT_ELEMENT)
 
-bool DragController::dragAttachmentElement(Frame& frame, HTMLAttachmentElement& attachment)
+PromisedBlobInfo DragController::promisedBlobInfo(Frame& frame, HTMLAttachmentElement& attachment)
 {
     if (!attachment.file())
-        return false;
+        return { };
 
     Vector<String> additionalTypes;
     Vector<RefPtr<SharedBuffer>> additionalData;
@@ -1317,9 +1321,7 @@ bool DragController::dragAttachmentElement(Frame& frame, HTMLAttachmentElement&
 #endif
 
     auto& file = *attachment.file();
-    m_client.prepareToDragPromisedBlob({ file.url(), platformContentTypeForBlobType(file.type()), file.name(), WTFMove(additionalTypes), WTFMove(additionalData) });
-
-    return true;
+    return { file.url(), platformContentTypeForBlobType(file.type()), file.name(), WTFMove(additionalTypes), WTFMove(additionalData) };
 }
 
 #endif // ENABLE(ATTACHMENT_ELEMENT)
index 7413609..83e575d 100644 (file)
@@ -48,6 +48,7 @@ class PlatformMouseEvent;
 
 struct DragItem;
 struct DragState;
+struct PromisedBlobInfo;
 
     class DragController {
         WTF_MAKE_NONCOPYABLE(DragController); WTF_MAKE_FAST_ALLOCATED;
@@ -115,7 +116,7 @@ struct DragState;
         bool shouldUseCachedImageForDragImage(const Image&) const;
 
         void doImageDrag(Element&, const IntPoint&, const IntRect&, Frame&, IntPoint&, const DragState&);
-        void doSystemDrag(DragImage, const IntPoint&, const IntPoint&, Frame&, const DragState&);
+        void doSystemDrag(DragImage, const IntPoint&, const IntPoint&, Frame&, const DragState&, PromisedBlobInfo&&);
 
         void beginDrag(DragItem, Frame&, const IntPoint& mouseDownPoint, const IntPoint& mouseDraggedPoint, DataTransfer&, DragSourceAction);
 
@@ -134,7 +135,7 @@ struct DragState;
         void declareAndWriteDragImage(DataTransfer&, Element&, const URL&, const String& label);
 
 #if ENABLE(ATTACHMENT_ELEMENT)
-        bool dragAttachmentElement(Frame&, HTMLAttachmentElement&);
+        PromisedBlobInfo promisedBlobInfo(Frame&, HTMLAttachmentElement&);
 #endif
         Page& m_page;
         DragClient& m_client;
index 25d4fd1..84405f6 100644 (file)
@@ -30,6 +30,7 @@
 #include "IntPoint.h"
 #include "IntRect.h"
 #include "PasteboardWriterData.h"
+#include "PromisedBlobInfo.h"
 
 namespace WebCore {
 
@@ -49,6 +50,7 @@ struct DragItem final {
     IntRect dragPreviewFrameInRootViewCoordinates;
 
     PasteboardWriterData data;
+    PromisedBlobInfo promisedBlob;
 
     template<class Encoder> void encode(Encoder&) const;
     template<class Decoder> static bool decode(Decoder&, DragItem&);
@@ -65,6 +67,7 @@ void DragItem::encode(Encoder& encoder) const
     encoder << hasIndicatorData;
     if (hasIndicatorData)
         encoder << image.indicatorData().value();
+    encoder << promisedBlob;
 }
 
 template<class Decoder>
@@ -98,6 +101,8 @@ bool DragItem::decode(Decoder& decoder, DragItem& result)
             return false;
         result.image.setIndicatorData(*indicatorData);
     }
+    if (!decoder.decode(result.promisedBlob))
+        return false;
     return true;
 }
 
index 8629ed1..2f4ba70 100644 (file)
 
 #pragma once
 
+#include "SharedBuffer.h"
+
 namespace WebCore {
 
-class SharedBuffer;
 class URL;
 
 struct PromisedBlobInfo {
index a85c8d5..e415c4b 100644 (file)
@@ -1,3 +1,39 @@
+2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
+        https://bugs.webkit.org/show_bug.cgi?id=181497
+
+        Reviewed by Tim Horton.
+
+        Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
+        via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
+        codepath that stages promised blob info.
+
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
+        * UIProcess/PageClient.h:
+        (WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _startDrag:item:]):
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
+        * WebProcess/WebCoreSupport/WebDragClient.cpp:
+        (WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
+        * WebProcess/WebCoreSupport/WebDragClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+
 2018-01-09  Per Arne Vollan  <pvollan@apple.com>
 
         VoiceOver does not work when the WebContent process is using NSRunLoop.
index b9ed3ec..b093c92 100644 (file)
@@ -535,8 +535,6 @@ public:
     void setIsCustomizingTouchBar(bool isCustomizingTouchBar) { m_isCustomizingTouchBar = isCustomizingTouchBar; };
 #endif // HAVE(TOUCH_BAR)
 
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&);
-
     bool beginBackSwipeForTesting();
     bool completeBackSwipeForTesting();
 
index ff260c2..4d2518c 100644 (file)
@@ -3769,12 +3769,6 @@ void WebViewImpl::registerDraggedTypes()
     [m_view registerForDraggedTypes:[types allObjects]];
 }
 
-void WebViewImpl::prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo& info)
-{
-    // FIXME: Add macOS support for dragging promised blob data as file promises.
-    UNUSED_PARAM(info);
-}
-
 #endif // ENABLE(DRAG_SUPPORT)
 
 void WebViewImpl::startWindowDrag()
index 6490027..51e9c01 100644 (file)
@@ -193,8 +193,6 @@ public:
     virtual void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) = 0;
 #endif
 
-    virtual void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&) { }
-
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) = 0;
index 803b66a..070c8f4 100644 (file)
@@ -7201,11 +7201,6 @@ void WebPageProxy::requestStorageAccess(String&& subFrameHost, String&& topFrame
 }
 #endif
 
-void WebPageProxy::prepareToDragPromisedBlob(const PromisedBlobInfo& info)
-{
-    m_pageClient.prepareToDragPromisedBlob(info);
-}
-
 #if PLATFORM(COCOA)
 void WebPageProxy::touchBarMenuDataChanged(const TouchBarMenuData& touchBarMenuData)
 {
index d88e59b..a9cbeda 100644 (file)
@@ -1254,8 +1254,6 @@ public:
     void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, uint64_t webProcessContextId);
 #endif
 
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&);
-
 #if ENABLE(ATTACHMENT_ELEMENT)
     void insertAttachment(const String& identifier, const WebCore::AttachmentDisplayOptions&, const String& filename, std::optional<String> contentType, WebCore::SharedBuffer& data, Function<void(CallbackBase::Error)>&&);
     void requestAttachmentInfo(const String& identifier, Function<void(const WebCore::AttachmentInfo&, CallbackBase::Error)>&&);
index 653bb1c..b0949bd 100644 (file)
@@ -513,6 +513,4 @@ messages -> WebPageProxy {
     DidInsertAttachment(String identifier)
     DidRemoveAttachment(String identifier)
 #endif
-
-    PrepareToDragPromisedBlob(struct WebCore::PromisedBlobInfo blobInfo)
 }
index 87d0152..a89cbeb 100644 (file)
@@ -208,8 +208,6 @@ private:
     void didChangeDataInteractionCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) override;
 #endif
 
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&) final;
-
     WKContentView *m_contentView;
     RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
 };
index 9120bf5..0aa15ea 100644 (file)
@@ -813,11 +813,6 @@ void PageClientImpl::requestPasswordForQuickLookDocument(const String& fileName,
 }
 #endif
 
-void PageClientImpl::prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo& info)
-{
-    [m_contentView _prepareToDragPromisedBlob:info];
-}
-
 } // namespace WebKit
 
 #endif // PLATFORM(IOS)
index 397bccb..3f01667 100644 (file)
@@ -327,7 +327,6 @@ FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item;
 - (void)_didConcludeEditDataInteraction:(std::optional<WebCore::TextIndicatorData>)data;
 - (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
-- (void)_prepareToDragPromisedBlob:(const WebCore::PromisedBlobInfo&)info;
 #endif
 
 @end
index 608302f..3704ff5 100644 (file)
@@ -4327,6 +4327,9 @@ static BOOL shouldEnableDragInteractionForPolicy(_WKDragInteractionPolicy policy
 {
     ASSERT(item.sourceAction != DragSourceActionNone);
 
+    if (item.promisedBlob)
+        [self _prepareToDragPromisedBlob:item.promisedBlob];
+
     auto dragImage = adoptNS([[UIImage alloc] initWithCGImage:image.get() scale:_page->deviceScaleFactor() orientation:UIImageOrientationUp]);
     _dragDropInteractionState.stageDragItem(item, dragImage.get());
 }
index 4179ab3..bb3df12 100644 (file)
@@ -250,8 +250,6 @@ private:
 
     void didRestoreScrollPosition() override;
     bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) override;
-
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&) final;
 };
 
 } // namespace WebKit
index 1f6388d..ca58cf1 100644 (file)
@@ -877,11 +877,6 @@ WebCore::UserInterfaceLayoutDirection PageClientImpl::userInterfaceLayoutDirecti
     return (m_view.userInterfaceLayoutDirection == NSUserInterfaceLayoutDirectionLeftToRight) ? WebCore::UserInterfaceLayoutDirection::LTR : WebCore::UserInterfaceLayoutDirection::RTL;
 }
 
-void PageClientImpl::prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo& info)
-{
-    m_impl->prepareToDragPromisedBlob(info);
-}
-
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)
index ec71c9b..5905718 100644 (file)
@@ -66,11 +66,6 @@ void WebDragClient::dragControllerDestroyed()
     delete this;
 }
 
-void WebDragClient::prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo& info)
-{
-    m_page->prepareToDragPromisedBlob(info);
-}
-
 } // namespace WebKit
 
 #endif // ENABLE(DRAG_SUPPORT)
index 2b2b297..9f7d7fc 100644 (file)
@@ -53,8 +53,6 @@ private:
     void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override;
 #endif
 
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&) final;
-
     void dragControllerDestroyed() override;
 
     WebPage* m_page;
index 48147aa..bb4289b 100644 (file)
@@ -3298,11 +3298,6 @@ bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt)
 
 #if ENABLE(DRAG_SUPPORT)
 
-void WebPage::prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo& info)
-{
-    send(Messages::WebPageProxy::PrepareToDragPromisedBlob(info));
-}
-
 #if PLATFORM(GTK)
 void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&& selection, uint32_t flags)
 {
index 5385685..f2ce726 100644 (file)
@@ -778,8 +778,6 @@ public:
     void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; }
     void didStartDrag();
     void dragCancelled();
-
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&);
 #endif
 
     void beginPrinting(uint64_t frameID, const PrintInfo&);
index 6c8e827..6ac92a3 100644 (file)
@@ -1,3 +1,14 @@
+2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
+        https://bugs.webkit.org/show_bug.cgi?id=181497
+
+        Reviewed by Tim Horton.
+
+        See other ChangeLogs for more detail.
+
+        * WebCoreSupport/WebDragClient.h:
+
 2018-01-11  Tim Horton  <timothy_horton@apple.com>
 
         Null deref in WebImmediateActionController _dictionaryPopupInfoForRange
index ced0dbc..4e81d37 100644 (file)
@@ -46,8 +46,6 @@ public:
     void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override;
     void didConcludeEditDrag() override;
 
-    void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&) final { }
-
 private:
     WebView* m_webView;
 };