Fix deadlock between UI thread and drag and drop thread on Windows.

During a drag and drop operation, drop targets may call
IDataObject::GetData() even though the drop is not yet complete.
This is problematic for DownloadURL since calling GetData() on the
stored CF_HDROP will actually trigger the download to start. In
order to prevent this, it called GetKeyState() to check if the left
mouse button was still down.

Chrome depends on the fact that this check is reliable, as it calls
GetData(CF_HDROP) to extract filenames when something is dragged
over a WebDropTargetWin. However, this is not a reliable heuristic
since the drag and drop loop doesn't run in the UI thread when
there is a DownloadURL in the drag. If the heuristic fails, this
results in a deadlock; the UI thread blocks in its call to
GetData(CF_HDROP) while the drag and drop thread is blocked on the
UI thread waiting for the download to complete.

In order to fix this, DataObjectImpl now has a bool member to track
whether the drag and drop operation is still in progress. On a
successful drop, WebDragSourceWin indicates that the drag operation
is complete prior to returning DRAGDROP_S_DROP.

BUG=163387

Review URL: https://codereview.chromium.org/13979012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196925 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed