intel / ozone-wayland

Wayland implementation for Chromium Ozone classes
BSD 3-Clause "New" or "Revised" License
218 stars 82 forks source link

Unfinished code in DesktopDragDropClientWayland::OnDragDrop #454

Open mcatanzaro opened 8 years ago

mcatanzaro commented 8 years ago

I made an error in DesktopDragDropClientWayland::OnDragDrop that I did not notice until after the code got committed. Kalyan noticed a race condition and asked me to fix it. I added a comment "Unlikely case" explaining the problem, and started writing some code to fix it, but promptly forgot; it got committed unfinished, oops. So the code under that comment basically does nothing. We need to add a way to wait until all the data has been received, and then call delegate_->OnPerformDrop, otherwise there is a race that could cause drops to fail if they contain huge amounts of data, or if the I/O is horrifically slow.

Ideally we would also add a test for this by faking the order that events are received in. desktop_drag_drop_client_aurax11_unittest.cc should provide inspiration.

(Not planning to fix this in the near future, I'm afraid; sorry for the error. Fortunately it's probably low-priority, as I doubt it would occur in practice.)