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. |