Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: content/browser/web_contents/web_drag_dest_gtk.cc

Issue 10704144: Fix a renderer crash when dragging quickly over tab contents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use data_requests_ Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_dest_gtk.cc
diff --git a/content/browser/web_contents/web_drag_dest_gtk.cc b/content/browser/web_contents/web_drag_dest_gtk.cc
index 20093f4a79826cd414efcc955e46d42c5b673961..b8768001463bf9423360021dbc781a4294a6dd8a 100644
--- a/content/browser/web_contents/web_drag_dest_gtk.cc
+++ b/content/browser/web_contents/web_drag_dest_gtk.cc
@@ -91,7 +91,6 @@ void WebDragDestGtk::UpdateDragStatus(WebDragOperation operation) {
void WebDragDestGtk::DragLeave() {
GetRenderViewHost()->DragTargetDragLeave();
-
if (delegate())
delegate()->OnDragLeave();
@@ -270,6 +269,12 @@ void WebDragDestGtk::OnDragLeave(GtkWidget* sender, GdkDragContext* context,
// as an enter.
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)
// 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698