Changeset 241659 in webkit


Ignore:
Timestamp:
Feb 18, 2019 1:12:48 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Crash while filling selection data during drag and drop
https://bugs.webkit.org/show_bug.cgi?id=194698

Reviewed by Michael Catanzaro.

I can't reproduce this, but it seems that m_draggingSelectionData is nullptr in fillDragData(). That can happen
when startDrag cancels a previous DND operation, because the new m_draggingSelectionData is set before the
current DND operation is cancelled, which sets it to nullptr.

  • UIProcess/gtk/DragAndDropHandler.cpp:

(WebKit::DragAndDropHandler::startDrag): Finish the previous operation before setting m_draggingSelectionData.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r241658 r241659  
     12019-02-18  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Crash while filling selection data during drag and drop
     4        https://bugs.webkit.org/show_bug.cgi?id=194698
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        I can't reproduce this, but it seems that m_draggingSelectionData is nullptr in fillDragData(). That can happen
     9        when startDrag cancels a previous DND operation, because the new m_draggingSelectionData is set before the
     10        current DND operation is cancelled, which sets it to nullptr.
     11
     12        * UIProcess/gtk/DragAndDropHandler.cpp:
     13        (WebKit::DragAndDropHandler::startDrag): Finish the previous operation before setting m_draggingSelectionData.
     14
    1152019-02-17  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/gtk/DragAndDropHandler.cpp

    r233305 r241659  
    108108{
    109109#if GTK_CHECK_VERSION(3, 16, 0)
     110    // WebCore::EventHandler does not support more than one DnD operation at the same time for
     111    // a given page, so we should cancel any previous operation whose context we might have
     112    // stored, should we receive a new startDrag event before finishing a previous DnD operation.
     113    if (m_dragContext) {
     114        gtk_drag_cancel(m_dragContext.get());
     115        m_dragContext = nullptr;
     116    }
     117
    110118    m_draggingSelectionData = WTFMove(selection);
    111119    GRefPtr<GtkTargetList> targetList = PasteboardHelper::singleton().targetListForSelectionData(*m_draggingSelectionData);
     
    120128
    121129#if GTK_CHECK_VERSION(3, 16, 0)
    122     // WebCore::EventHandler does not support more than one DnD operation at the same time for
    123     // a given page, so we should cancel any previous operation whose context we might have
    124     // stored, should we receive a new startDrag event before finishing a previous DnD operation.
    125     if (m_dragContext)
    126         gtk_drag_cancel(m_dragContext.get());
    127130    m_dragContext = context;
    128131#else
Note: See TracChangeset for help on using the changeset viewer.