Diff
Modified: trunk/Source/WebCore/ChangeLog (261801 => 261802)
--- trunk/Source/WebCore/ChangeLog 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebCore/ChangeLog 2020-05-18 08:37:39 UTC (rev 261802)
@@ -1,5 +1,21 @@
2020-05-18 Carlos Garcia Campos <[email protected]>
+ [GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word
+ https://bugs.webkit.org/show_bug.cgi?id=211957
+
+ Reviewed by Adrian Perez de Castro.
+
+ Make SelectionData non-refcounted. We can just move in most of the cases to avoid copies.
+
+ * platform/Pasteboard.h:
+ * platform/gtk/PasteboardGtk.cpp:
+ (WebCore::Pasteboard::createForDragAndDrop):
+ (WebCore::Pasteboard::Pasteboard):
+ (WebCore::Pasteboard::selectionData const):
+ * platform/gtk/SelectionData.h:
+
+2020-05-18 Carlos Garcia Campos <[email protected]>
+
[GTK] Add WebKitContextMenuItemType for paste as plaintext
https://bugs.webkit.org/show_bug.cgi?id=177638
Modified: trunk/Source/WebCore/platform/Pasteboard.h (261801 => 261802)
--- trunk/Source/WebCore/platform/Pasteboard.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebCore/platform/Pasteboard.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -43,6 +43,10 @@
OBJC_CLASS NSArray;
#endif
+#if PLATFORM(GTK)
+#include "SelectionData.h"
+#endif
+
#if PLATFORM(WIN)
#include "COMPtr.h"
#include "WCDataObject.h"
@@ -62,7 +66,6 @@
class Frame;
class PasteboardStrategy;
class Range;
-class SelectionData;
class SharedBuffer;
enum class PlainTextURLReadingPolicy : bool { IgnoreURL, AllowURL };
@@ -176,7 +179,10 @@
#if PLATFORM(GTK)
explicit Pasteboard(const String& name);
explicit Pasteboard(SelectionData&);
+#if ENABLE(DRAG_SUPPORT)
+ explicit Pasteboard(SelectionData&&);
#endif
+#endif
#if PLATFORM(WIN)
explicit Pasteboard(IDataObject*);
@@ -317,7 +323,7 @@
#endif
#if PLATFORM(GTK)
- RefPtr<SelectionData> m_selectionData;
+ Optional<SelectionData> m_selectionData;
String m_name;
#endif
Modified: trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp (261801 => 261802)
--- trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -27,7 +27,6 @@
#include "NotImplemented.h"
#include "PasteboardStrategy.h"
#include "PlatformStrategies.h"
-#include "SelectionData.h"
#include "SharedBuffer.h"
#include <wtf/NeverDestroyed.h>
#include <wtf/Optional.h>
@@ -57,7 +56,7 @@
#if ENABLE(DRAG_SUPPORT)
std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop()
{
- return makeUnique<Pasteboard>(SelectionData::create());
+ return makeUnique<Pasteboard>(SelectionData());
}
std::unique_ptr<Pasteboard> Pasteboard::createForDragAndDrop(const DragData& dragData)
@@ -65,10 +64,15 @@
ASSERT(dragData.platformData());
return makeUnique<Pasteboard>(*dragData.platformData());
}
+
+Pasteboard::Pasteboard(SelectionData&& selectionData)
+ : m_selectionData(WTFMove(selectionData))
+{
+}
#endif
Pasteboard::Pasteboard(SelectionData& selectionData)
- : m_selectionData(&selectionData)
+ : m_selectionData(selectionData)
{
}
@@ -83,7 +87,7 @@
const SelectionData& Pasteboard::selectionData() const
{
ASSERT(m_selectionData);
- return *m_selectionData.get();
+ return *m_selectionData;
}
static ClipboardDataType selectionDataTypeFromHTMLClipboardType(const String& type)
Modified: trunk/Source/WebCore/platform/gtk/SelectionData.h (261801 => 261802)
--- trunk/Source/WebCore/platform/gtk/SelectionData.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebCore/platform/gtk/SelectionData.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -21,20 +21,14 @@
#include "Image.h"
#include "SharedBuffer.h"
#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
#include <wtf/URL.h>
#include <wtf/text/StringHash.h>
namespace WebCore {
-class SelectionData : public RefCounted<SelectionData> {
+class SelectionData {
WTF_MAKE_FAST_ALLOCATED;
public:
- static Ref<SelectionData> create()
- {
- return adoptRef(*new SelectionData);
- }
-
void setText(const String&);
const String& text() const { return m_text; }
bool hasText() const { return !m_text.isEmpty(); }
Modified: trunk/Source/WebKit/ChangeLog (261801 => 261802)
--- trunk/Source/WebKit/ChangeLog 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/ChangeLog 2020-05-18 08:37:39 UTC (rev 261802)
@@ -1,5 +1,66 @@
2020-05-18 Carlos Garcia Campos <[email protected]>
+ [GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word
+ https://bugs.webkit.org/show_bug.cgi?id=211957
+
+ Reviewed by Adrian Perez de Castro.
+
+ Remove WebSelectionData wrapper since we can just encode/decode WebCore::SelectionData.
+
+ * Shared/WebCoreArgumentCoders.h:
+ * Shared/gtk/ArgumentCodersGtk.cpp:
+ (IPC::ArgumentCoder<SelectionData>::decode): Use modern decoder.
+ * Shared/gtk/ArgumentCodersGtk.h:
+ * Shared/gtk/WebSelectionData.cpp: Removed.
+ * Shared/gtk/WebSelectionData.h: Removed.
+ * SourcesGTK.txt:
+ * UIProcess/API/gtk/DragSource.h:
+ * UIProcess/API/gtk/DragSourceGtk3.cpp:
+ (WebKit::DragSource::DragSource):
+ (WebKit::DragSource::begin):
+ * UIProcess/API/gtk/DragSourceGtk4.cpp:
+ (WebKit::DragSource::begin):
+ * UIProcess/API/gtk/DropTarget.h:
+ * UIProcess/API/gtk/DropTargetGtk3.cpp:
+ (WebKit::DropTarget::accept):
+ (WebKit::DropTarget::enter):
+ (WebKit::DropTarget::update):
+ (WebKit::DropTarget::leaveTimerFired):
+ (WebKit::DropTarget::drop):
+ * UIProcess/API/gtk/PageClientImpl.cpp:
+ (WebKit::PageClientImpl::startDrag):
+ * UIProcess/API/gtk/PageClientImpl.h:
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseStartDrag):
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::performDragControllerAction):
+ (WebKit::WebPageProxy::startDrag):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/WebPasteboardProxy.h:
+ * UIProcess/WebPasteboardProxy.messages.in:
+ * UIProcess/gtk/Clipboard.h:
+ * UIProcess/gtk/ClipboardGtk3.cpp:
+ (WebKit::WriteAsyncData::WriteAsyncData):
+ (WebKit::Clipboard::write):
+ * UIProcess/gtk/ClipboardGtk4.cpp:
+ (WebKit::Clipboard::write):
+ * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
+ (WebKit::WebPasteboardProxy::writeToClipboard):
+ (WebKit::WebPasteboardProxy::writeCustomData):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebKit::WebPlatformStrategies::writeToClipboard):
+ * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
+ (WebKit::WebDragClient::startDrag):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::performDragControllerAction):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
+2020-05-18 Carlos Garcia Campos <[email protected]>
+
[GTK] Add WebKitContextMenuItemType for paste as plaintext
https://bugs.webkit.org/show_bug.cgi?id=177638
Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (261801 => 261802)
--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -62,6 +62,10 @@
#include <WebCore/CDMInstanceSession.h>
#endif
+#if PLATFORM(GTK)
+#include "ArgumentCodersGtk.h"
+#endif
+
#if PLATFORM(COCOA)
namespace WTF {
class MachSendRight;
Modified: trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.cpp (261801 => 261802)
--- trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -101,76 +101,76 @@
encoder << canSmartReplace;
}
-bool ArgumentCoder<SelectionData>::decode(Decoder& decoder, SelectionData& selection)
+Optional<SelectionData> ArgumentCoder<SelectionData>::decode(Decoder& decoder)
{
- selection.clearAll();
+ SelectionData selection;
bool hasText;
if (!decoder.decode(hasText))
- return false;
+ return WTF::nullopt;
if (hasText) {
String text;
if (!decoder.decode(text))
- return false;
+ return WTF::nullopt;
selection.setText(text);
}
bool hasMarkup;
if (!decoder.decode(hasMarkup))
- return false;
+ return WTF::nullopt;
if (hasMarkup) {
String markup;
if (!decoder.decode(markup))
- return false;
+ return WTF::nullopt;
selection.setMarkup(markup);
}
bool hasURL;
if (!decoder.decode(hasURL))
- return false;
+ return WTF::nullopt;
if (hasURL) {
String url;
if (!decoder.decode(url))
- return false;
+ return WTF::nullopt;
selection.setURL(URL(URL(), url), String());
}
bool hasURIList;
if (!decoder.decode(hasURIList))
- return false;
+ return WTF::nullopt;
if (hasURIList) {
String uriList;
if (!decoder.decode(uriList))
- return false;
+ return WTF::nullopt;
selection.setURIList(uriList);
}
bool hasImage;
if (!decoder.decode(hasImage))
- return false;
+ return WTF::nullopt;
if (hasImage) {
RefPtr<Image> image;
if (!decodeImage(decoder, image))
- return false;
+ return WTF::nullopt;
selection.setImage(image.get());
}
bool hasCustomData;
if (!decoder.decode(hasCustomData))
- return false;
+ return WTF::nullopt;
if (hasCustomData) {
RefPtr<SharedBuffer> buffer;
if (!decoder.decode(buffer))
- return false;
+ return WTF::nullopt;
selection.setCustomData(Ref<SharedBuffer>(*buffer));
}
bool canSmartReplace;
if (!decoder.decode(canSmartReplace))
- return false;
+ return WTF::nullopt;
selection.setCanSmartReplace(canSmartReplace);
- return true;
+ return selection;
}
static void encodeGKeyFile(Encoder& encoder, GKeyFile* keyFile)
Modified: trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.h (261801 => 261802)
--- trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/Shared/gtk/ArgumentCodersGtk.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ArgumentCodersGtk_h
-#define ArgumentCodersGtk_h
+#pragma once
#include "ArgumentCoders.h"
#include <wtf/glib/GRefPtr.h>
@@ -46,9 +45,7 @@
template<> struct ArgumentCoder<WebCore::SelectionData> {
static void encode(Encoder&, const WebCore::SelectionData&);
- static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::SelectionData&);
+ static Optional<WebCore::SelectionData> decode(Decoder&);
};
} // namespace IPC
-
-#endif // ArgumentCodersGtk_h
Deleted: trunk/Source/WebKit/Shared/gtk/WebSelectionData.cpp (261801 => 261802)
--- trunk/Source/WebKit/Shared/gtk/WebSelectionData.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/Shared/gtk/WebSelectionData.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "WebSelectionData.h"
-
-#include "ArgumentCodersGtk.h"
-#include "Decoder.h"
-#include "Encoder.h"
-#include <wtf/RetainPtr.h>
-
-namespace WebKit {
-
-WebSelectionData::WebSelectionData()
- : selectionData(WebCore::SelectionData::create())
-{
-}
-
-WebSelectionData::WebSelectionData(const WebCore::SelectionData& data)
- : selectionData(const_cast<WebCore::SelectionData&>(data))
-{
-}
-
-WebSelectionData::WebSelectionData(Ref<WebCore::SelectionData>&& data)
- : selectionData(WTFMove(data))
-{
-}
-
-WebSelectionData::WebSelectionData(WebCore::SelectionData&& data)
- : selectionData(data)
-{
-}
-
-void WebSelectionData::encode(IPC::Encoder& encoder) const
-{
- encoder << selectionData.get();
-}
-
-bool WebSelectionData::decode(IPC::Decoder& decoder, WebSelectionData& selection)
-{
- return decoder.decode(selection.selectionData.get());
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit/Shared/gtk/WebSelectionData.h (261801 => 261802)
--- trunk/Source/WebKit/Shared/gtk/WebSelectionData.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/Shared/gtk/WebSelectionData.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#pragma once
-
-#include <WebCore/SelectionData.h>
-
-namespace IPC {
-class Decoder;
-class Encoder;
-}
-
-namespace WebKit {
-
-struct WebSelectionData {
- WebSelectionData();
- explicit WebSelectionData(const WebCore::SelectionData&);
- explicit WebSelectionData(Ref<WebCore::SelectionData>&&);
- explicit WebSelectionData(WebCore::SelectionData&&);
-
- Ref<WebCore::SelectionData> selectionData;
-
- void encode(IPC::Encoder&) const;
- static WARN_UNUSED_RETURN bool decode(IPC::Decoder&, WebSelectionData&);
-};
-
-} // namespace WebKit
-
Modified: trunk/Source/WebKit/SourcesGTK.txt (261801 => 261802)
--- trunk/Source/WebKit/SourcesGTK.txt 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/SourcesGTK.txt 2020-05-18 08:37:39 UTC (rev 261802)
@@ -103,7 +103,6 @@
Shared/gtk/PrintInfoGtk.cpp
Shared/gtk/WebErrorsGtk.cpp
Shared/gtk/WebEventFactory.cpp
-Shared/gtk/WebSelectionData.cpp
Shared/linux/WebMemorySamplerLinux.cpp
Modified: trunk/Source/WebKit/UIProcess/API/gtk/DragSource.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/DragSource.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/DragSource.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -28,6 +28,7 @@
#if ENABLE(DRAG_SUPPORT)
#include <WebCore/DragActions.h>
+#include <WebCore/SelectionData.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/glib/GRefPtr.h>
@@ -38,10 +39,6 @@
typedef struct _GdkDragContext GdkDragContext;
#endif
-namespace WebCore {
-class SelectionData;
-}
-
namespace WebKit {
class ShareableBitmap;
@@ -53,7 +50,7 @@
explicit DragSource(GtkWidget*);
~DragSource();
- void begin(Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&&);
+ void begin(WebCore::SelectionData&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&&);
private:
GtkWidget* m_webView { nullptr };
@@ -60,7 +57,7 @@
#if !USE(GTK4)
GRefPtr<GdkDragContext> m_drag;
#endif
- RefPtr<WebCore::SelectionData> m_selectionData;
+ Optional<WebCore::SelectionData> m_selectionData;
};
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk3.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk3.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk3.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -84,7 +84,7 @@
if (!drag.m_selectionData)
return;
- drag.m_selectionData = nullptr;
+ drag.m_selectionData = WTF::nullopt;
drag.m_drag = nullptr;
GdkDevice* device = gdk_drag_context_get_device(context);
@@ -106,7 +106,7 @@
g_signal_handlers_disconnect_by_data(m_webView, this);
}
-void DragSource::begin(Ref<SelectionData>&& selectionData, DragOperation operation, RefPtr<ShareableBitmap>&& image)
+void DragSource::begin(SelectionData&& selectionData, DragOperation operation, RefPtr<ShareableBitmap>&& image)
{
if (m_drag) {
gtk_drag_cancel(m_drag.get());
Modified: trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk4.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk4.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/DragSourceGtk4.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -44,7 +44,7 @@
{
}
-void DragSource::begin(Ref<SelectionData>&&, DragOperation, RefPtr<ShareableBitmap>&&)
+void DragSource::begin(SelectionData&&, DragOperation, RefPtr<ShareableBitmap>&&)
{
}
Modified: trunk/Source/WebKit/UIProcess/API/gtk/DropTarget.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/DropTarget.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/DropTarget.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -29,6 +29,7 @@
#include <WebCore/DragActions.h>
#include <WebCore/IntPoint.h>
+#include <WebCore/SelectionData.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/RunLoop.h>
@@ -41,10 +42,6 @@
typedef struct _GtkSelectionData GtkSelectionData;
#endif
-namespace WebCore {
-class SelectionData;
-}
-
namespace WebKit {
class ShareableBitmap;
@@ -75,7 +72,7 @@
#endif
Optional<WebCore::IntPoint> m_position;
unsigned m_dataRequestCount { 0 };
- RefPtr<WebCore::SelectionData> m_selectionData;
+ Optional<WebCore::SelectionData> m_selectionData;
WebCore::DragOperation m_operation { WebCore::DragOperationNone };
#if !USE(GTK4)
RunLoop::Timer<DropTarget> m_leaveTimer;
Modified: trunk/Source/WebKit/UIProcess/API/gtk/DropTargetGtk3.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/DropTargetGtk3.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/DropTargetGtk3.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -103,7 +103,7 @@
}
m_dataRequestCount = 0;
- m_selectionData = SelectionData::create();
+ m_selectionData = SelectionData();
// WebCore needs the selection data to decide, so we need to preload the
// data of targets we support. Once all data requests are done we start
@@ -141,7 +141,7 @@
ASSERT(page);
page->resetCurrentDragInformation();
- DragData dragData(m_selectionData.get(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())));
+ DragData dragData(&m_selectionData.value(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())));
page->dragEntered(dragData);
}
@@ -155,7 +155,7 @@
auto* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_webView));
ASSERT(page);
- DragData dragData(m_selectionData.get(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())));
+ DragData dragData(&m_selectionData.value(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())));
page->dragUpdated(dragData);
}
@@ -229,13 +229,13 @@
auto* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_webView));
ASSERT(page);
- DragData dragData(m_selectionData.get(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), DragOperationNone);
+ DragData dragData(&m_selectionData.value(), *m_position, convertWidgetPointToScreenPoint(m_webView, *m_position), DragOperationNone);
page->dragExited(dragData);
page->resetCurrentDragInformation();
m_drop = nullptr;
m_position = WTF::nullopt;
- m_selectionData = nullptr;
+ m_selectionData = WTF::nullopt;
}
void DropTarget::leave()
@@ -256,13 +256,13 @@
uint32_t flags = 0;
if (gdk_drag_context_get_selected_action(m_drop.get()) == GDK_ACTION_COPY)
flags |= DragApplicationIsCopyKeyDown;
- DragData dragData(m_selectionData.get(), position, convertWidgetPointToScreenPoint(m_webView, position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())), static_cast<DragApplicationFlags>(flags));
+ DragData dragData(&m_selectionData.value(), position, convertWidgetPointToScreenPoint(m_webView, position), gdkDragActionToDragOperation(gdk_drag_context_get_actions(m_drop.get())), static_cast<DragApplicationFlags>(flags));
page->performDragOperation(dragData, { }, { }, { });
gtk_drag_finish(m_drop.get(), TRUE, FALSE, time);
m_drop = nullptr;
m_position = WTF::nullopt;
- m_selectionData = nullptr;
+ m_selectionData = WTF::nullopt;
}
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -328,7 +328,7 @@
}
#if ENABLE(DRAG_SUPPORT)
-void PageClientImpl::startDrag(Ref<SelectionData>&& selection, DragOperation dragOperation, RefPtr<ShareableBitmap>&& dragImage)
+void PageClientImpl::startDrag(SelectionData&& selection, DragOperation dragOperation, RefPtr<ShareableBitmap>&& dragImage)
{
webkitWebViewBaseStartDrag(WEBKIT_WEB_VIEW_BASE(m_viewWidget), WTFMove(selection), dragOperation, WTFMove(dragImage));
}
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -100,7 +100,7 @@
void selectionDidChange() override;
RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&) override;
#if ENABLE(DRAG_SUPPORT)
- void startDrag(Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) override;
+ void startDrag(WebCore::SelectionData&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) override;
void didPerformDragControllerAction() override;
#endif
Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -1779,7 +1779,7 @@
}
#if ENABLE(DRAG_SUPPORT)
-void webkitWebViewBaseStartDrag(WebKitWebViewBase* webViewBase, Ref<SelectionData>&& selectionData, DragOperation dragOperation, RefPtr<ShareableBitmap>&& image)
+void webkitWebViewBaseStartDrag(WebKitWebViewBase* webViewBase, SelectionData&& selectionData, DragOperation dragOperation, RefPtr<ShareableBitmap>&& image)
{
WebKitWebViewBasePrivate* priv = webViewBase->priv;
if (!priv->dragSource)
Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -82,7 +82,7 @@
void webkitWebViewBasePageClosed(WebKitWebViewBase*);
#if ENABLE(DRAG_SUPPORT)
-void webkitWebViewBaseStartDrag(WebKitWebViewBase*, Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<WebKit::ShareableBitmap>&&);
+void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, WebCore::DragOperation, RefPtr<WebKit::ShareableBitmap>&&);
void webkitWebViewBaseDidPerformDragControllerAction(WebKitWebViewBase*);
#endif
Modified: trunk/Source/WebKit/UIProcess/PageClient.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -250,7 +250,7 @@
#if ENABLE(DRAG_SUPPORT)
#if PLATFORM(GTK)
- virtual void startDrag(Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) = 0;
+ virtual void startDrag(WebCore::SelectionData&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) = 0;
#else
virtual void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle&) { }
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -225,7 +225,7 @@
#endif
#if PLATFORM(GTK)
-#include "WebSelectionData.h"
+#include <WebCore/SelectionData.h>
#endif
#if USE(CAIRO)
@@ -2410,8 +2410,7 @@
m_process->assumeReadAccessToBaseURL(*this, url);
ASSERT(dragData.platformData());
- WebSelectionData selection(*dragData.platformData());
- send(Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), selection, dragData.flags()));
+ send(Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()));
#else
send(Messages::WebPage::PerformDragControllerAction(action, dragData, sandboxExtensionHandle, sandboxExtensionsForUpload));
#endif
@@ -2431,10 +2430,10 @@
}
#if PLATFORM(GTK)
-void WebPageProxy::startDrag(WebSelectionData&& selection, uint64_t dragOperation, const ShareableBitmap::Handle& dragImageHandle)
+void WebPageProxy::startDrag(SelectionData&& selectionData, uint64_t dragOperation, const ShareableBitmap::Handle& dragImageHandle)
{
RefPtr<ShareableBitmap> dragImage = !dragImageHandle.isNull() ? ShareableBitmap::create(dragImageHandle) : nullptr;
- pageClient().startDrag(WTFMove(selection.selectionData), static_cast<WebCore::DragOperation>(dragOperation), WTFMove(dragImage));
+ pageClient().startDrag(WTFMove(selectionData), static_cast<WebCore::DragOperation>(dragOperation), WTFMove(dragImage));
didStartDrag();
}
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -219,6 +219,7 @@
class IntSize;
class ProtectionSpace;
class RunLoopObserver;
+class SelectionData;
class SharedBuffer;
class TextIndicator;
class ValidationBubble;
@@ -350,7 +351,6 @@
struct WebHitTestResultData;
struct WebNavigationDataStore;
struct WebPopupItem;
-struct WebSelectionData;
struct WebSpeechSynthesisVoice;
struct URLSchemeTaskParameters;
struct UserMessage;
@@ -1164,7 +1164,7 @@
const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
#endif
#if PLATFORM(GTK)
- void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
+ void startDrag(WebCore::SelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
#endif
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2020-05-18 08:37:39 UTC (rev 261802)
@@ -318,7 +318,7 @@
SetPromisedDataForImage(String pasteboardName, WebKit::SharedMemory::Handle imageHandle, uint64_t imageSize, String filename, String extension, String title, String url, String visibleURL, WebKit::SharedMemory::Handle archiveHandle, uint64_t archiveSize)
#endif
#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
- StartDrag(struct WebKit::WebSelectionData selection, uint64_t dragOperation, WebKit::ShareableBitmap::Handle dragImage)
+ StartDrag(WebCore::SelectionData selectionData, uint64_t dragOperation, WebKit::ShareableBitmap::Handle dragImage)
#endif
#if ENABLE(DRAG_SUPPORT)
Modified: trunk/Source/WebKit/UIProcess/WebPasteboardProxy.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/WebPasteboardProxy.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/WebPasteboardProxy.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -41,6 +41,7 @@
namespace WebCore {
class Color;
class PasteboardCustomData;
+class SelectionData;
struct PasteboardImage;
struct PasteboardItemInfo;
struct PasteboardURL;
@@ -51,7 +52,6 @@
class WebFrameProxy;
class WebProcessProxy;
-struct WebSelectionData;
class WebPasteboardProxy : public IPC::MessageReceiver {
WTF_MAKE_NONCOPYABLE(WebPasteboardProxy);
@@ -127,7 +127,7 @@
void readText(const String& pasteboardName, CompletionHandler<void(String&&)>&&);
void readFilePaths(const String& pasteboardName, CompletionHandler<void(Vector<String>&&)>&&);
void readBuffer(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(IPC::SharedBufferDataReference&&)>&&);
- void writeToClipboard(const String& pasteboardName, WebSelectionData&&);
+ void writeToClipboard(const String& pasteboardName, WebCore::SelectionData&&);
void clearClipboard(const String& pasteboardName);
WebFrameProxy* m_primarySelectionOwner { nullptr };
Modified: trunk/Source/WebKit/UIProcess/WebPasteboardProxy.messages.in (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/WebPasteboardProxy.messages.in 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/WebPasteboardProxy.messages.in 2020-05-18 08:37:39 UTC (rev 261802)
@@ -65,7 +65,7 @@
ReadText(String pasteboardName) -> (String text) Synchronous
ReadFilePaths(String pasteboardName) -> (Vector<String> types) Synchronous
ReadBuffer(String pasteboardName, String pasteboardType) -> (IPC::SharedBufferDataReference data) Synchronous
- WriteToClipboard(String pasteboardName, struct WebKit::WebSelectionData pasteboardContent)
+ WriteToClipboard(String pasteboardName, WebCore::SelectionData pasteboardContent)
ClearClipboard(String pasteboardName)
#endif
Modified: trunk/Source/WebKit/UIProcess/gtk/Clipboard.h (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/gtk/Clipboard.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/gtk/Clipboard.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -56,7 +56,7 @@
void readText(CompletionHandler<void(String&&)>&&);
void readFilePaths(CompletionHandler<void(Vector<String>&&)>&&);
void readBuffer(const char*, CompletionHandler<void(Ref<WebCore::SharedBuffer>&&)>&&);
- void write(Ref<WebCore::SelectionData>&&);
+ void write(WebCore::SelectionData&&);
void clear();
private:
Modified: trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk3.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk3.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk3.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -146,34 +146,34 @@
struct WriteAsyncData {
WTF_MAKE_STRUCT_FAST_ALLOCATED;
- WriteAsyncData(Ref<WebCore::SelectionData>&& selection, Clipboard& clipboard)
+ WriteAsyncData(WebCore::SelectionData&& selection, Clipboard& clipboard)
: selectionData(WTFMove(selection))
, clipboard(clipboard)
{
}
- Ref<WebCore::SelectionData> selectionData;
+ WebCore::SelectionData selectionData;
Clipboard& clipboard;
};
enum ClipboardTargetType { Markup, Text, Image, URIList, SmartPaste, Custom };
-void Clipboard::write(Ref<WebCore::SelectionData>&& selectionData)
+void Clipboard::write(WebCore::SelectionData&& selectionData)
{
SetForScope<WebFrameProxy*> frameWritingToClipboard(m_frameWritingToClipboard, WebPasteboardProxy::singleton().primarySelectionOwner());
GRefPtr<GtkTargetList> list = adoptGRef(gtk_target_list_new(nullptr, 0));
- if (selectionData->hasURIList())
+ if (selectionData.hasURIList())
gtk_target_list_add(list.get(), gdk_atom_intern_static_string("text/uri-list"), 0, ClipboardTargetType::URIList);
- if (selectionData->hasMarkup())
+ if (selectionData.hasMarkup())
gtk_target_list_add(list.get(), gdk_atom_intern_static_string("text/html"), 0, ClipboardTargetType::Markup);
- if (selectionData->hasImage())
+ if (selectionData.hasImage())
gtk_target_list_add_image_targets(list.get(), ClipboardTargetType::Image, TRUE);
- if (selectionData->hasText())
+ if (selectionData.hasText())
gtk_target_list_add_text_targets(list.get(), ClipboardTargetType::Text);
- if (selectionData->canSmartReplace())
+ if (selectionData.canSmartReplace())
gtk_target_list_add(list.get(), gdk_atom_intern_static_string("application/vnd.webkitgtk.smartpaste"), 0, ClipboardTargetType::SmartPaste);
- if (selectionData->hasCustomData())
+ if (selectionData.hasCustomData())
gtk_target_list_add(list.get(), gdk_atom_intern_static_string(WebCore::PasteboardCustomData::gtkType()), 0, ClipboardTargetType::Custom);
int numberOfTargets;
@@ -187,25 +187,24 @@
gboolean succeeded = gtk_clipboard_set_with_data(m_clipboard, table, numberOfTargets,
[](GtkClipboard*, GtkSelectionData* selection, guint info, gpointer userData) {
auto& data = ""
- auto& selectionData = data.selectionData.get();
switch (info) {
case ClipboardTargetType::Markup: {
- CString markup = selectionData.markup().utf8();
+ CString markup = data.selectionData.markup().utf8();
gtk_selection_data_set(selection, gdk_atom_intern_static_string("text/html"), 8, reinterpret_cast<const guchar*>(markup.data()), markup.length());
break;
}
case ClipboardTargetType::Text:
- gtk_selection_data_set_text(selection, selectionData.text().utf8().data(), -1);
+ gtk_selection_data_set_text(selection, data.selectionData.text().utf8().data(), -1);
break;
case ClipboardTargetType::Image: {
- if (selectionData.hasImage()) {
- GRefPtr<GdkPixbuf> pixbuf = adoptGRef(selectionData.image()->getGdkPixbuf());
+ if (data.selectionData.hasImage()) {
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(data.selectionData.image()->getGdkPixbuf());
gtk_selection_data_set_pixbuf(selection, pixbuf.get());
}
break;
}
case ClipboardTargetType::URIList: {
- CString uriList = selectionData.uriList().utf8();
+ CString uriList = data.selectionData.uriList().utf8();
gtk_selection_data_set(selection, gdk_atom_intern_static_string("text/uri-list"), 8, reinterpret_cast<const guchar*>(uriList.data()), uriList.length());
break;
}
@@ -213,8 +212,8 @@
gtk_selection_data_set_text(selection, "", -1);
break;
case ClipboardTargetType::Custom:
- if (selectionData.hasCustomData()) {
- auto* buffer = selectionData.customData();
+ if (data.selectionData.hasCustomData()) {
+ auto* buffer = data.selectionData.customData();
gtk_selection_data_set(selection, gdk_atom_intern_static_string(WebCore::PasteboardCustomData::gtkType()), 8, reinterpret_cast<const guchar*>(buffer->data()), buffer->size());
}
break;
Modified: trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk4.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk4.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/gtk/ClipboardGtk4.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -156,36 +156,36 @@
}, new ReadBufferAsyncData(WTFMove(completionHandler)));
}
-void Clipboard::write(Ref<WebCore::SelectionData>&& selectionData)
+void Clipboard::write(WebCore::SelectionData&& selectionData)
{
Vector<GdkContentProvider*> providers;
- if (selectionData->hasMarkup()) {
- CString markup = selectionData->markup().utf8();
+ if (selectionData.hasMarkup()) {
+ CString markup = selectionData.markup().utf8();
GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new(markup.data(), markup.length()));
providers.append(gdk_content_provider_new_for_bytes("text/html", bytes.get()));
}
- if (selectionData->hasURIList()) {
- CString uriList = selectionData->uriList().utf8();
+ if (selectionData.hasURIList()) {
+ CString uriList = selectionData.uriList().utf8();
GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new(uriList.data(), uriList.length()));
providers.append(gdk_content_provider_new_for_bytes("text/uri-list", bytes.get()));
}
- if (selectionData->hasImage()) {
- GRefPtr<GdkPixbuf> pixbuf = adoptGRef(selectionData->image()->getGdkPixbuf());
+ if (selectionData.hasImage()) {
+ GRefPtr<GdkPixbuf> pixbuf = adoptGRef(selectionData.image()->getGdkPixbuf());
providers.append(gdk_content_provider_new_typed(GDK_TYPE_PIXBUF, pixbuf.get()));
}
- if (selectionData->hasText())
- providers.append(gdk_content_provider_new_typed(G_TYPE_STRING, selectionData->text().utf8().data()));
+ if (selectionData.hasText())
+ providers.append(gdk_content_provider_new_typed(G_TYPE_STRING, selectionData.text().utf8().data()));
- if (selectionData->canSmartReplace()) {
+ if (selectionData.canSmartReplace()) {
GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new(nullptr, 0));
providers.append(gdk_content_provider_new_for_bytes("application/vnd.webkitgtk.smartpaste", bytes.get()));
}
- if (selectionData->hasCustomData()) {
- GRefPtr<GBytes> bytes = selectionData->customData()->createGBytes();
+ if (selectionData.hasCustomData()) {
+ GRefPtr<GBytes> bytes = selectionData.customData()->createGBytes();
providers.append(gdk_content_provider_new_for_bytes(WebCore::PasteboardCustomData::gtkType(), bytes.get()));
}
Modified: trunk/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp (261801 => 261802)
--- trunk/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -29,11 +29,11 @@
#include "Clipboard.h"
#include "SharedBufferDataReference.h"
#include "WebFrameProxy.h"
-#include "WebSelectionData.h"
#include <WebCore/Pasteboard.h>
#include <WebCore/PasteboardCustomData.h>
#include <WebCore/PasteboardItemInfo.h>
#include <WebCore/PlatformPasteboard.h>
+#include <WebCore/SelectionData.h>
#include <WebCore/SharedBuffer.h>
#include <wtf/ListHashSet.h>
#include <wtf/SetForScope.h>
@@ -61,9 +61,9 @@
Clipboard::get(pasteboardName).readBuffer(pasteboardType.utf8().data(), WTFMove(completionHandler));
}
-void WebPasteboardProxy::writeToClipboard(const String& pasteboardName, WebSelectionData&& selection)
+void WebPasteboardProxy::writeToClipboard(const String& pasteboardName, SelectionData&& selectionData)
{
- Clipboard::get(pasteboardName).write(WTFMove(selection.selectionData));
+ Clipboard::get(pasteboardName).write(WTFMove(selectionData));
}
void WebPasteboardProxy::clearClipboard(const String& pasteboardName)
@@ -123,21 +123,21 @@
return;
}
- auto selectionData = SelectionData::create();
+ SelectionData selectionData;
const auto& customData = data[0];
customData.forEachPlatformStringOrBuffer([&selectionData] (auto& type, auto& stringOrBuffer) {
if (WTF::holds_alternative<String>(stringOrBuffer)) {
if (type == "text/plain"_s)
- selectionData->setText(WTF::get<String>(stringOrBuffer));
+ selectionData.setText(WTF::get<String>(stringOrBuffer));
else if (type == "text/html"_s)
- selectionData->setMarkup(WTF::get<String>(stringOrBuffer));
+ selectionData.setMarkup(WTF::get<String>(stringOrBuffer));
else if (type == "text/uri-list"_s)
- selectionData->setURIList(WTF::get<String>(stringOrBuffer));
+ selectionData.setURIList(WTF::get<String>(stringOrBuffer));
}
});
if (customData.hasSameOriginCustomData() || !customData.origin().isEmpty())
- selectionData->setCustomData(customData.createSharedBuffer());
+ selectionData.setCustomData(customData.createSharedBuffer());
Clipboard::get(pasteboardName).write(WTFMove(selectionData));
completionHandler(0);
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (261801 => 261802)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -71,7 +71,7 @@
#endif
#if PLATFORM(GTK)
-#include "WebSelectionData.h"
+#include <WebCore/SelectionData.h>
#endif
namespace WebKit {
@@ -325,7 +325,7 @@
void WebPlatformStrategies::writeToClipboard(const String& pasteboardName, SelectionData&& selectionData)
{
- WebProcess::singleton().parentProcessConnection()->send(Messages::WebPasteboardProxy::WriteToClipboard(pasteboardName, WebSelectionData(selectionData)), 0);
+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebPasteboardProxy::WriteToClipboard(pasteboardName, WTFMove(selectionData)), 0);
}
void WebPlatformStrategies::clearClipboard(const String& pasteboardName)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp (261801 => 261802)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -32,7 +32,6 @@
#include "ShareableBitmap.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
-#include "WebSelectionData.h"
#include <WebCore/CairoOperations.h>
#include <WebCore/DataTransfer.h>
#include <WebCore/DragData.h>
@@ -39,6 +38,7 @@
#include <WebCore/GraphicsContext.h>
#include <WebCore/Pasteboard.h>
#include <WebCore/PlatformContextCairo.h>
+#include <WebCore/SelectionData.h>
#include <cairo.h>
namespace WebKit {
@@ -75,8 +75,7 @@
m_page->willStartDrag();
- WebSelectionData selection(dataTransfer.pasteboard().selectionData());
- m_page->send(Messages::WebPageProxy::StartDrag(selection, dataTransfer.sourceOperation(), handle));
+ m_page->send(Messages::WebPageProxy::StartDrag(dataTransfer.pasteboard().selectionData(), dataTransfer.sourceOperation(), handle));
}
}; // namespace WebKit.
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (261801 => 261802)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-05-18 08:37:39 UTC (rev 261802)
@@ -281,7 +281,7 @@
#if PLATFORM(GTK)
#include "WebPrintOperationGtk.h"
-#include "WebSelectionData.h"
+#include <WebCore/SelectionData.h>
#include <gtk/gtk.h>
#endif
@@ -3936,7 +3936,7 @@
#if ENABLE(DRAG_SUPPORT)
#if PLATFORM(GTK)
-void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&& selection, uint32_t flags)
+void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t draggingSourceOperationMask, SelectionData&& selectionData, uint32_t flags)
{
if (!m_page) {
send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, DragHandlingMethod::None, false, 0, { }, { }));
@@ -3943,7 +3943,7 @@
return;
}
- DragData dragData(selection.selectionData.ptr(), clientPosition, globalPosition, static_cast<DragOperation>(draggingSourceOperationMask), static_cast<DragApplicationFlags>(flags));
+ DragData dragData(&selectionData, clientPosition, globalPosition, static_cast<DragOperation>(draggingSourceOperationMask), static_cast<DragApplicationFlags>(flags));
switch (action) {
case DragControllerAction::Entered: {
DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (261801 => 261802)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2020-05-18 08:37:39 UTC (rev 261802)
@@ -186,6 +186,7 @@
class Range;
class ResourceRequest;
class ResourceResponse;
+class SelectionData;
class SelectionRect;
class SharedBuffer;
class SubstituteData;
@@ -296,7 +297,6 @@
struct WebAutocorrectionContext;
struct WebPageCreationParameters;
struct WebPreferencesStore;
-struct WebSelectionData;
struct WebsitePoliciesData;
#if ENABLE(UI_SIDE_COMPOSITING)
@@ -895,7 +895,7 @@
void restoreSelectionInFocusedEditableElement();
#if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK)
- void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&&, uint32_t flags);
+ void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebCore::SelectionData&&, uint32_t flags);
#endif
#if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (261801 => 261802)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2020-05-18 08:14:47 UTC (rev 261801)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2020-05-18 08:37:39 UTC (rev 261802)
@@ -307,7 +307,7 @@
# Drag and drop.
#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
- PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, struct WebKit::WebSelectionData selection, uint32_t flags)
+ PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WebCore::SelectionData selection, uint32_t flags)
#endif
#if !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::SandboxExtension::HandleArray sandboxExtensionsForUpload)