Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Issue 492163002: Fix Profile* lifetime issues in Chrome's AppListViewDelegate (Closed)

Created:
6 years, 4 months ago by tapted
Modified:
6 years, 3 months ago
Reviewers:
xiyuan, Matt Giuca
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, sadrul, ben+ash_chromium.org, kalyank
Project:
chromium
Visibility:
Public.

Description

Fix 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -86 lines) Patch
M chrome/browser/ui/app_list/app_list_service_impl.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -7 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_interactive_uitest.cc View 1 2 3 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_mac.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_mac.mm View 1 2 3 4 5 6 7 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_unittest.cc View 1 2 3 4 5 6 3 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/ui/app_list/app_list_service_views.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_views.cc View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_view_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +15 lines, -3 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_view_delegate.cc View 1 2 3 4 5 6 7 9 7 chunks +98 lines, -75 lines 0 comments Download
M chrome/browser/ui/ash/app_list/app_list_service_ash.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/app_list/app_list_service_ash.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
tapted
I think this is ready for a Matt - PTAL
6 years, 4 months ago (2014-08-22 04:26:53 UTC) #1
Matt Giuca
OK, I've read over it and I think I've made all the comments I want ...
6 years, 4 months ago (2014-08-25 04:48:46 UTC) #2
tapted
Thanks matt! Comments addressed. I also put a contrived diff in patchset 9 that just ...
6 years, 4 months ago (2014-08-25 06:17:01 UTC) #3
Matt Giuca
https://codereview.chromium.org/492163002/diff/120001/chrome/browser/ui/app_list/app_list_service_mac.mm File chrome/browser/ui/app_list/app_list_service_mac.mm (right): https://codereview.chromium.org/492163002/diff/120001/chrome/browser/ui/app_list/app_list_service_mac.mm#newcode399 chrome/browser/ui/app_list/app_list_service_mac.mm:399: setDelegate:delegate.PassAs<app_list::AppListViewDelegate>()]; But you reverted the use of PassAs now? ...
6 years, 4 months ago (2014-08-26 01:29:45 UTC) #4
Matt Giuca
lgtm
6 years, 4 months ago (2014-08-26 01:29:52 UTC) #5
tapted
Patchset #12 (id:220001) has been deleted
6 years, 4 months ago (2014-08-26 02:38:20 UTC) #6
tapted
tapted@chromium.org changed reviewers: + xiyuan@chromium.org
6 years, 4 months ago (2014-08-26 02:43:57 UTC) #7
tapted
+xiyuan for OWNERS in chrome/browser/ui/ash/app_list/ - please take a look https://codereview.chromium.org/492163002/diff/120001/chrome/browser/ui/app_list/app_list_service_mac.mm File chrome/browser/ui/app_list/app_list_service_mac.mm (right): https://codereview.chromium.org/492163002/diff/120001/chrome/browser/ui/app_list/app_list_service_mac.mm#newcode399 ...
6 years, 4 months ago (2014-08-26 02:43:57 UTC) #8
xiyuan
chrome/browser/ui/ash/app_list/ LGTM
6 years, 4 months ago (2014-08-26 02:58:24 UTC) #9
tapted
wow! that was quick. Thanks all!
6 years, 4 months ago (2014-08-26 02:59:37 UTC) #10
tapted
The CQ bit was checked by tapted@chromium.org
6 years, 4 months ago (2014-08-26 02:59:53 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/492163002/240001
6 years, 4 months ago (2014-08-26 03:00:25 UTC) #12
commit-bot: I haz the power
Committed patchset #12 (240001) as 0cb217b650b73017769f50d271b25e597d7622e8
6 years, 4 months ago (2014-08-26 05:55:03 UTC) #13
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 02:40:53 UTC) #14
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/adcde472fce55457f2dff391d96e2ae0992d0362
Cr-Commit-Position: refs/heads/master@{#291852}

Powered by Google App Engine
This is Rietveld 408576698