[GTK] WebProcess crashes when quickly attempting many DnD operations
https://bugs.webkit.org/show_bug.cgi?id=138468
Reviewed by Michael Catanzaro.
Source/WebKit2:
Do not allow different DnD operations over the same element at the
same time, so that any new attempt to DnD an element happening before
a previous attempt has ended will take precedence, cancelling the older
operation before going ahead with the new one.
This is consistent with how WebCore::EventHandler handles DnD operations,
preventing the web process from crashing in scenarios where the user might
try to perform many DnD operations over the same element very quickly.
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::DragAndDropHandler): Initialized new member.
(WebKit::DragAndDropHandler::startDrag): Ensure a previous DnD operation
is cancelled before handling the new one that has just started.
(WebKit::DragAndDropHandler::fillDragData): Protect against calling this
function from webkitWebViewBaseDragDataGet for already cancelled operations.
(WebKit::DragAndDropHandler::finishDrag): Protect against calling this
function from webkitWebViewBaseDragEnd for already cancelled operations.
* UIProcess/gtk/DragAndDropHandler.h:
LayoutTests:
New test added to check that the web process does not crash when multiple
DnD operations are quickly attempted over the same draggable element.
* fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash-expected.txt: Added.
* fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html: Added.
Added the new test to the failure expectations for mac-wk2, as there's no
suitable implementation of eventSender in place yet (see bug 42194).
* platform/mac-wk2/TestExpectations: Added failure expectation for the new test.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed