зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1636740 - Block CMemStream::Read only if the drop target initiated an async operation. r=aklotz
If the drop target did not initiate an async operation, `DoDragDrop` will block on the main thread until the data transfer completes. Although the `ObtainCachedIconFile` callback itself will run off the main thread, `ObtainCachedIconFile` will end up with calling `NotifyIconObservers` that heavily relies on the main thread. So `ObtainCachedIconFile` will have no chance to run the callback. To complete the data transfer, however, the `ObtainCachedIconFile` callback must signal the event object to unblock `CMemStream::Read`. Deadlock. Differential Revision: https://phabricator.services.mozilla.com/D75531
This commit is contained in:
Родитель
b93b459b46
Коммит
bccfb6df94
|
@ -1360,6 +1360,11 @@ nsDataObj ::GetFileContentsInternetShortcut(FORMATETC& aFE, STGMEDIUM& aSTG) {
|
|||
::GlobalUnlock(globalMem.get());
|
||||
|
||||
if (aFE.tymed & TYMED_ISTREAM) {
|
||||
if (!mIsInOperation) {
|
||||
// The drop target didn't initiate an async operation.
|
||||
// We can't block CMemStream::Read.
|
||||
event = nullptr;
|
||||
}
|
||||
RefPtr<IStream> stream =
|
||||
new CMemStream(globalMem.disown(), totalLen, event.forget());
|
||||
stream.forget(&aSTG.pstm);
|
||||
|
|
Загрузка…
Ссылка в новой задаче