Commit 992e528e authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Pass a WeakPersistent ScrollableArea object to a ScrollCallback

Make ScrollableArea WeakPersistent so we do not need to worry about
when we call "area->MarkHoverStateDirty()", ScrollableArea object
"area" has been destructed.

Bug: 978830
Change-Id: I0e0c11987e4d87e1c8718dbe582354d349771c2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678257Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672584}
parent ec608fec
......@@ -324,7 +324,7 @@ bool ScrollManager::LogicalScroll(ScrollDirection direction,
if (area)
area->MarkHoverStateDirty();
},
scrollable_area));
WrapWeakPersistent(scrollable_area)));
}
ScrollResult result = scrollable_area->UserScroll(
granularity, ToScrollDelta(physical_direction, 1), std::move(callback));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment