Skip to content

Commit

Permalink
Ensure WFWI::current_drag_data_ is null at the end of a drag.
Browse files Browse the repository at this point in the history
This is a tentative fix for the DCHECK bugs below.  The bugs appeared at
two different times, but they share the common symptom that
WebFrameWidgetImpl::DragTargetDragEnter very infrequently encounters a
non-null current_drag_data_.  We were not able to repro the problem.

This tentative fix assumes that an early return on a drag-leave may
be accidentally skipping setting the state to null.

Bug: 1316301, 1367848
Change-Id: Ib6e9e000271515a0659a6780a59467db149d3b3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645670
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1075157}
  • Loading branch information
mustaqahmed authored and Chromium LUCI CQ committed Nov 23, 2022
1 parent bc7f6f5 commit 88da1e1
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ void WebFrameWidgetImpl::CancelDrag() {
if (!doing_drag_and_drop_)
return;
GetPage()->GetDragController().DragEnded();
current_drag_data_ = nullptr;
doing_drag_and_drop_ = false;
}

Expand Down

0 comments on commit 88da1e1

Please sign in to comment.