DescriptionAppListModel / AppsGridView: Better error handling for corner cases.
Fixes a potential crash if an app gets duplicated in the app list, and
the user tries to drop it onto itself. (There is no known way to repro
this currently, but there was recently; see http://crbug.com/415530.)
That situation will now result in a very descriptive DCHECK, rather than
a confusing low-level CHECK fail.
AppListModel::MergeItems:
- returns "" instead of crashing if the source and target IDs are equal.
- returns "" instead of crashing if the target ID is inside a folder (no
longer needs to explicitly CHECK whether it is in a folder.)
Added plenty of new tests for the various corner cases in
AppListModel::MergeItems which would have caught these crashes.
AppsGridView::MoveItemToFolder:
- DCHECKs for a NULL result of GetViewAtSlotOnCurrentPage.
- DCHECKs that you aren't dropping an item onto itself (this should
never happen).
BUG=417482
Committed: https://crrev.com/aebcdf88e420f281c950d741106e25dcdf0625e3
Cr-Commit-Position: refs/heads/master@{#297356}
Patch Set 1 #
Total comments: 5
Patch Set 2 : Rebase. #Patch Set 3 : Comment. #
Messages
Total messages: 11 (3 generated)
|