app_list: Fix UAF after menu close.
App list now uses ui::SimpleMenuModel created in chrome directly. The SimpleMenuModel uses AppContextMenu as its delegate and its life time is bound to ChromeAppListItem and ChromeSearchResult, which is different with the UI associated with them. When menu is dismissed, it schedules SimpleMenuModel::OnMenuClosed() call and could be reached after chrome side AppContextMenu is released. The CL wire up OnMenuClosed in the UI elements to releases the menu model. This happens before chrome releasing AppContextMenu on dismissing app list. Bug: 965848 Test: Select "App Info" on context menu of SearchResultTileItemView. Change-Id: I56dfbb0551c336b31326297ca01eab6e166529bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625649Reviewed-by:Xiyuan Xia <xiyuan@chromium.org> Reviewed-by:
Alex Newcomer <newcomer@chromium.org> Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/master@{#662277}
Showing
Please register or sign in to comment