• Masatoshi Kimura's avatar
    Bug 1636740 - Block CMemStream::Read only if the drop target initiated an... · b4461e4e
    Masatoshi Kimura authored
    Bug 1636740 - Block CMemStream::Read only if the drop target initiated an async operation. r=aklotz, a=pascalc
    
    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
    b4461e4e