summaryrefslogtreecommitdiffstats
path: root/app/os_exchange_data_provider_win.cc
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-16 22:17:05 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-16 22:17:05 +0000
commit13897f5adc091bdb1000e61fcec730cfcfd53a9f (patch)
tree97e895ba4069b03b898c013c27be04a23881cde1 /app/os_exchange_data_provider_win.cc
parent9393d635e9e49f21631fca011d87ac7be1b19d23 (diff)
downloadchromium_src-13897f5adc091bdb1000e61fcec730cfcfd53a9f.zip
chromium_src-13897f5adc091bdb1000e61fcec730cfcfd53a9f.tar.gz
chromium_src-13897f5adc091bdb1000e61fcec730cfcfd53a9f.tar.bz2
Fix 2 drag-out problems:
1) Does not work if dragging out to XP desktop. We need to return an error code when waiting for XP Shell to start a background thread. 2) Occasional crash due to regression caused by r43726. Fix it by holding a local reference to drag_source_. BUG=none TEST=none Review URL: http://codereview.chromium.org/1619023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/os_exchange_data_provider_win.cc')
-rw-r--r--app/os_exchange_data_provider_win.cc33
1 files changed, 17 insertions, 16 deletions
diff --git a/app/os_exchange_data_provider_win.cc b/app/os_exchange_data_provider_win.cc
index 578f1fd..ed33b3c 100644
--- a/app/os_exchange_data_provider_win.cc
+++ b/app/os_exchange_data_provider_win.cc
@@ -633,24 +633,25 @@ HRESULT DataObjectImpl::GetData(FORMATETC* format_etc, STGMEDIUM* medium) {
}
}
- if (wait_for_data) {
- // Notify the observer we start waiting for the data. This gives
- // an observer a chance to end the drag and drop.
- if (observer_)
- observer_->OnWaitForData();
-
- // Now we can start the download.
- if ((*iter)->downloader.get()) {
- if (!(*iter)->downloader->Start(this)) {
- is_aborting_ = true;
- return DV_E_FORMATETC;
- }
+ if (!wait_for_data)
+ return DV_E_FORMATETC;
+
+ // Notify the observer we start waiting for the data. This gives
+ // an observer a chance to end the drag and drop.
+ if (observer_)
+ observer_->OnWaitForData();
+
+ // Now we can start the download.
+ if ((*iter)->downloader.get()) {
+ if (!(*iter)->downloader->Start(this)) {
+ is_aborting_ = true;
+ return DV_E_FORMATETC;
}
-
- // The stored data should have been updated with the final version.
- // So we just need to call this function again to retrieve it.
- return GetData(format_etc, medium);
}
+
+ // The stored data should have been updated with the final version.
+ // So we just need to call this function again to retrieve it.
+ return GetData(format_etc, medium);
}
return S_OK;
}