DescriptionFix Profile* lifetime issues in Chrome's AppListViewDelegate
Currently AppListViewDelegate can hold on to references to a destroyed
Profile*. It's managed to escape crashing in most cases so far because
the LocalState pref is updated for the next time the app launcher is
shown. However, if the profile the app launcher is first created for is
ever deleted in the same session, then a crash usually follows (but
doesn't always create a crash dump, due to a corrupt stack).
This decouples the Profile from the AppListViewDelegate constructor to
make it clear the lifetimes are not in step. Then "SetProfile" correctly
tears down any references to an old profile, before setting a new one.
When the app list's active profile is deleted, the AppListViewDelegate
is destroyed by forcibly closing/destroying the AppList's widget via a
new method AppListServiceImpl::DestroyAppList().
BUG=392763, 403647, 373689, 405827
TEST=(windows) Show the app list, right-click an app and "uninstall".
Leave the uninstall dialog open. Switch to a chrome://settings in a
browser and delete the profile being shown in the app list. App list
should close.
Committed: https://crrev.com/adcde472fce55457f2dff391d96e2ae0992d0362
Cr-Commit-Position: refs/heads/master@{#291852}
Patch Set 1 #Patch Set 2 : before rebasing - add DestroyAppList #Patch Set 3 : rebase to master #Patch Set 4 : add a test #Patch Set 5 : rebase #Patch Set 6 : fix mac #Patch Set 7 : update unit test, cl format #
Total comments: 22
Patch Set 8 : respond to comments #Patch Set 9 : reorder functions for a neater diff #Patch Set 10 : fix function ordering #Patch Set 11 : fix typo #Patch Set 12 : Add constructor comment #Messages
Total messages: 14 (0 generated)
|