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

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

Issue 13979012: Fix deadlock between UI thread and drag and drop thread on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retain Created 7 years, 8 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 | content/browser/web_contents/web_drag_source_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_drag_win.cc
diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc
index f0cc0366254b893108e66a35023f51221fcd9b27..c66391c8210a5ed3465e0c41271340bc3d9ecbd8 100644
--- a/content/browser/web_contents/web_contents_drag_win.cc
+++ b/content/browser/web_contents/web_contents_drag_win.cc
@@ -360,13 +360,16 @@ bool WebContentsDragWin::DoDragging(const WebDropData& drop_data,
// Keep a reference count such that |drag_source_| will not get deleted
// if the contents view window is gone in the nested message loop invoked
// from DoDragDrop.
- scoped_refptr<WebDragSource> retain_this(drag_source_);
+ scoped_refptr<WebDragSource> retain_source(drag_source_);
+ retain_source->set_data(&data);
+ data.SetInDragLoop(true);
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
drag_source_,
WebDragOpMaskToWinDragOpMask(ops),
&effect);
+ retain_source->set_data(NULL);
}
// Bail out immediately if the contents view window is gone.
« no previous file with comments | « no previous file | content/browser/web_contents/web_drag_source_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698