Commit 391dad7d authored by tony@chromium.org's avatar tony@chromium.org

Fix a renderer crash when dragging quickly over tab contents.

We were expecting to receive GTK+ events in the following order:
  drag-motion
  drag-data-received
  drag-leave
but in some cases, we don't get the drag-data-received event (e.g.,
if the user is moving the mouse quickly). If that happens, don't send
a DragLeave event to the renderer since it doesn't think we're in a
drag.

BUG=129446
TEST=Open 2 chrome windows, quickly drag a file from the desktop over both
  windows. This should not crash.


Review URL: https://chromiumcodereview.appspot.com/10704144

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146016 0039d316-1c4b-4281-b951-d872f2087c98
parent 8aae4551
...@@ -91,7 +91,6 @@ void WebDragDestGtk::UpdateDragStatus(WebDragOperation operation) { ...@@ -91,7 +91,6 @@ void WebDragDestGtk::UpdateDragStatus(WebDragOperation operation) {
void WebDragDestGtk::DragLeave() { void WebDragDestGtk::DragLeave() {
GetRenderViewHost()->DragTargetDragLeave(); GetRenderViewHost()->DragTargetDragLeave();
if (delegate()) if (delegate())
delegate()->OnDragLeave(); delegate()->OnDragLeave();
...@@ -270,6 +269,12 @@ void WebDragDestGtk::OnDragLeave(GtkWidget* sender, GdkDragContext* context, ...@@ -270,6 +269,12 @@ void WebDragDestGtk::OnDragLeave(GtkWidget* sender, GdkDragContext* context,
// as an enter. // as an enter.
context_ = NULL; context_ = NULL;
// Sometimes we get a drag-leave event before getting a drag-data-received
// event. In that case, we don't want to bother the renderer with a
// DragLeave event.
if (data_requests_ != 0)
return;
// When GTK sends us a drag-drop signal, it is shortly (and synchronously) // When GTK sends us a drag-drop signal, it is shortly (and synchronously)
// preceded by a drag-leave. The renderer doesn't like getting the signals // preceded by a drag-leave. The renderer doesn't like getting the signals
// in this order so delay telling it about the drag-leave till we are sure // in this order so delay telling it about the drag-leave till we are sure
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment