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

Issue 14923004: [Mac] AppController needs to update its "last profile" pointer when the active profile is deleted (Closed)

Created:
7 years, 7 months ago by noms (inactive)
Modified:
7 years, 5 months ago
CC:
chromium-reviews, sail+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[Mac] AppController needs to update its "last profile" pointer when the active profile is deleted. Otherwise, when the next browser window is opened, it will try to use the old "last used" profile, which is the one that just got deleted. This also means that the ProfileManager needs to pre-load the next active profile, if one is not loaded already. BUG=194415 TEST=On Mac, create two profiles. Ensure only the active profile has opened browser windows. Delete the active profile. All windows should close, but the Chrome icon should still be highlighted in the dock. Clicking it should not crash, and should open a window for the remaining profile. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=209035

Patch Set 1 #

Total comments: 4

Patch Set 2 : Refactored #

Patch Set 3 : Fixed style #

Total comments: 7

Patch Set 4 : Virtual functions should be marked virtual #

Total comments: 6

Patch Set 5 : checkpoint #

Patch Set 6 : Fix race condition and made code awesomer #

Patch Set 7 : Fix whitespace #

Total comments: 14

Patch Set 8 : Drive-by fixes #

Total comments: 6

Patch Set 9 : deal with multiple simultaneous deletions #

Total comments: 18

Patch Set 10 : yay, unit tests!! #

Patch Set 11 : rebase & fixed comments #

Total comments: 27

Patch Set 12 : refactored tests #

Patch Set 13 : rebase #

Total comments: 9

Patch Set 14 : fix recursive call and add test for it #

Total comments: 8

Patch Set 15 : nits #

Patch Set 16 : nits #

Total comments: 12

Patch Set 17 : fix broken windows code #

Total comments: 16

Patch Set 18 : last nits #

Patch Set 19 : rebase #

Patch Set 20 : fix import order after rebase #

Patch Set 21 : fix android test #

Patch Set 22 : derp. no test on CrOS either. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+376 lines, -47 lines) Patch
M chrome/browser/app_controller_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/app_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +67 lines, -0 lines 0 comments Download
M chrome/browser/app_controller_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +50 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +64 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 9 chunks +175 lines, -40 lines 0 comments Download

Messages

Total messages: 49 (0 generated)
noms (inactive)
Hi Alexei, Here's a first draft of the fix for the profile deletion bug. Would ...
7 years, 7 months ago (2013-05-07 20:31:40 UTC) #1
Alexei Svitkine (slow)
Since the C++ class is so small, you can just put it at the top ...
7 years, 7 months ago (2013-05-07 20:38:53 UTC) #2
Roger Tawa OOO till Jul 10th
https://codereview.chromium.org/14923004/diff/1/chrome/browser/app_controller_profile_observer.h File chrome/browser/app_controller_profile_observer.h (right): https://codereview.chromium.org/14923004/diff/1/chrome/browser/app_controller_profile_observer.h#newcode32 chrome/browser/app_controller_profile_observer.h:32: }; I think you need DISALLOW_COPY_AND_ASSIGN() here. https://codereview.chromium.org/14923004/diff/1/chrome/browser/app_controller_profile_observer.mm File ...
7 years, 7 months ago (2013-05-07 20:54:15 UTC) #3
noms (inactive)
https://codereview.chromium.org/14923004/diff/1/chrome/browser/app_controller_profile_observer.h File chrome/browser/app_controller_profile_observer.h (right): https://codereview.chromium.org/14923004/diff/1/chrome/browser/app_controller_profile_observer.h#newcode32 chrome/browser/app_controller_profile_observer.h:32: }; On 2013/05/07 20:54:15, Roger Tawa wrote: > I ...
7 years, 7 months ago (2013-05-08 15:19:35 UTC) #4
Alexei Svitkine (slow)
https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm#newcode204 chrome/browser/app_controller_mac.mm:204: profile_manager_->GetProfileInfoCache().AddObserver(this); I don't think you need the DCHECK() if ...
7 years, 7 months ago (2013-05-08 15:25:06 UTC) #5
noms (inactive)
https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm#newcode204 chrome/browser/app_controller_mac.mm:204: profile_manager_->GetProfileInfoCache().AddObserver(this); I originally had an if (profile_manager_) check, and ...
7 years, 7 months ago (2013-05-08 15:56:53 UTC) #6
Alexei Svitkine (slow)
https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm#newcode204 chrome/browser/app_controller_mac.mm:204: profile_manager_->GetProfileInfoCache().AddObserver(this); On 2013/05/08 15:56:53, Monica Dinculescu wrote: > I ...
7 years, 7 months ago (2013-05-08 16:32:07 UTC) #7
noms (inactive)
https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/10001/chrome/browser/app_controller_mac.mm#newcode213 chrome/browser/app_controller_mac.mm:213: ProfileManager* profile_manager_; On 2013/05/08 15:25:06, Alexei Svitkine wrote: > ...
7 years, 7 months ago (2013-05-08 19:10:35 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/14923004/diff/15001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/15001/chrome/browser/app_controller_mac.mm#newcode536 chrome/browser/app_controller_mac.mm:536: g_browser_process->profile_manager()->GetLastUsedProfile()]; Wouldn't this still be a problem? i.e. I ...
7 years, 7 months ago (2013-05-08 19:19:11 UTC) #9
noms (inactive)
https://codereview.chromium.org/14923004/diff/15001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/15001/chrome/browser/app_controller_mac.mm#newcode536 chrome/browser/app_controller_mac.mm:536: g_browser_process->profile_manager()->GetLastUsedProfile()]; And how! However, fixed. On 2013/05/08 19:19:11, Alexei ...
7 years, 7 months ago (2013-05-14 03:34:17 UTC) #10
Roger Tawa OOO till Jul 10th
Drive by comments. https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.h File chrome/browser/app_controller_mac.h (right): https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.h#newcode43 chrome/browser/app_controller_mac.h:43: BOOL lastProfileWasDeleted; Please add trailing _ ...
7 years, 7 months ago (2013-05-14 14:38:40 UTC) #11
noms (inactive)
https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.mm#newcode571 chrome/browser/app_controller_mac.mm:571: lastProfileWasDeleted = NO; There is no constructor per se, ...
7 years, 7 months ago (2013-05-14 14:49:38 UTC) #12
noms (inactive)
https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.h File chrome/browser/app_controller_mac.h (right): https://codereview.chromium.org/14923004/diff/25001/chrome/browser/app_controller_mac.h#newcode43 chrome/browser/app_controller_mac.h:43: BOOL lastProfileWasDeleted; On 2013/05/14 14:38:40, Roger Tawa wrote: > ...
7 years, 7 months ago (2013-05-14 15:06:48 UTC) #13
Alexei Svitkine (slow)
I think this is on the right track. https://codereview.chromium.org/14923004/diff/31001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/31001/chrome/browser/profiles/profile_manager.cc#newcode1071 chrome/browser/profiles/profile_manager.cc:1071: bool ...
7 years, 7 months ago (2013-05-14 15:34:12 UTC) #14
noms (inactive)
+ Jeremy Jeremy, do you have any insights on whether this is the right way ...
7 years, 7 months ago (2013-05-15 14:31:42 UTC) #15
jeremy
Hi Monica, First off, thank you so much for tackling this and finding the root ...
7 years, 7 months ago (2013-05-16 11:47:41 UTC) #16
noms (inactive)
Oh, sorry! Miranda had cc'ed you on the bug, so I thought you'd be the ...
7 years, 7 months ago (2013-05-16 14:56:18 UTC) #17
jeremy
On Thu, May 16, 2013 at 5:56 PM, <noms@chromium.org> wrote: > Oh, sorry! Miranda had ...
7 years, 7 months ago (2013-05-16 15:19:00 UTC) #18
noms (inactive)
https://codereview.chromium.org/14923004/diff/31001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/31001/chrome/browser/profiles/profile_manager.cc#newcode1071 chrome/browser/profiles/profile_manager.cc:1071: bool new_last_profile_being_loaded = false; On 2013/05/14 15:34:12, Alexei Svitkine ...
7 years, 6 months ago (2013-06-05 18:16:38 UTC) #19
Alexei Svitkine (slow)
Comments your way. Still waiting for a test! https://codereview.chromium.org/14923004/diff/43001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/43001/chrome/browser/app_controller_mac.mm#newcode786 chrome/browser/app_controller_mac.mm:786: lastProfileWasDeleted_ ...
7 years, 6 months ago (2013-06-05 20:00:52 UTC) #20
noms (inactive)
https://codereview.chromium.org/14923004/diff/43001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/43001/chrome/browser/app_controller_mac.mm#newcode786 chrome/browser/app_controller_mac.mm:786: lastProfileWasDeleted_ = YES; yup, you're right. Done. On 2013/06/05 ...
7 years, 6 months ago (2013-06-11 19:32:16 UTC) #21
noms
Hi Sailesh, I made some changes to profile deletion code in the ProfileManager. Would you ...
7 years, 6 months ago (2013-06-12 21:00:00 UTC) #22
Alexei Svitkine (slow)
I still need to look at the new tests to properly review them, but here's ...
7 years, 6 months ago (2013-06-12 21:02:31 UTC) #23
sail
https://codereview.chromium.org/14923004/diff/57001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/app_controller_mac.mm#newcode223 chrome/browser/app_controller_mac.mm:223: [app_controller_ profileWasRemoved:profile_name]; It would be more direct to use ...
7 years, 6 months ago (2013-06-12 21:16:48 UTC) #24
Alexei Svitkine (slow)
And some more comments your way... https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager_unittest.cc File chrome/browser/profiles/profile_manager_unittest.cc (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager_unittest.cc#newcode502 chrome/browser/profiles/profile_manager_unittest.cc:502: ProfileInfoCache& cache = ...
7 years, 6 months ago (2013-06-12 21:42:23 UTC) #25
noms (inactive)
https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc#newcode400 chrome/browser/profiles/profile_manager.cc:400: continue; This is a rebase gone wrong. Same for ...
7 years, 6 months ago (2013-06-13 14:23:55 UTC) #26
sail
https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc#newcode1075 chrome/browser/profiles/profile_manager.cc:1075: // On the Mac, the browser process is not ...
7 years, 6 months ago (2013-06-13 14:33:49 UTC) #27
Alexei Svitkine (slow)
https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/profiles/profile_manager.cc#newcode1075 chrome/browser/profiles/profile_manager.cc:1075: // On the Mac, the browser process is not ...
7 years, 6 months ago (2013-06-13 14:48:00 UTC) #28
noms (inactive)
https://codereview.chromium.org/14923004/diff/57001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/57001/chrome/browser/app_controller_mac.mm#newcode223 chrome/browser/app_controller_mac.mm:223: [app_controller_ profileWasRemoved:profile_name]; On 2013/06/12 21:16:49, sail wrote: > It ...
7 years, 6 months ago (2013-06-13 20:56:25 UTC) #29
sail
lgtm
7 years, 6 months ago (2013-06-13 21:05:59 UTC) #30
Alexei Svitkine (slow)
In addition to what we discussed offline, here's some nits. https://codereview.chromium.org/14923004/diff/82001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/82001/chrome/browser/profiles/profile_manager.cc#newcode1093 ...
7 years, 6 months ago (2013-06-14 22:04:58 UTC) #31
noms (inactive)
https://codereview.chromium.org/14923004/diff/82001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/82001/chrome/browser/profiles/profile_manager.cc#newcode1093 chrome/browser/profiles/profile_manager.cc:1093: // For OS_MACOSX the pref is updated in the ...
7 years, 6 months ago (2013-06-18 21:38:10 UTC) #32
Alexei Svitkine (slow)
https://codereview.chromium.org/14923004/diff/90001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/90001/chrome/browser/profiles/profile_manager.cc#newcode1058 chrome/browser/profiles/profile_manager.cc:1058: ProfilesToDelete().end(), cur_path) != ProfilesToDelete().end(); Can you make a helper ...
7 years, 6 months ago (2013-06-18 21:45:56 UTC) #33
noms (inactive)
https://codereview.chromium.org/14923004/diff/90001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/90001/chrome/browser/profiles/profile_manager.cc#newcode1058 chrome/browser/profiles/profile_manager.cc:1058: ProfilesToDelete().end(), cur_path) != ProfilesToDelete().end(); On 2013/06/18 21:45:57, Alexei Svitkine ...
7 years, 6 months ago (2013-06-18 22:19:55 UTC) #34
Alexei Svitkine (slow)
You also have a compile error on win. https://codereview.chromium.org/14923004/diff/102001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/102001/chrome/browser/profiles/profile_manager.cc#newcode1112 chrome/browser/profiles/profile_manager.cc:1112: status ...
7 years, 6 months ago (2013-06-19 14:58:31 UTC) #35
noms (inactive)
https://codereview.chromium.org/14923004/diff/102001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/14923004/diff/102001/chrome/browser/profiles/profile_manager.cc#newcode1112 chrome/browser/profiles/profile_manager.cc:1112: status == Profile::CREATE_STATUS_LOCAL_FAIL || I've added a DCHECK. On ...
7 years, 6 months ago (2013-06-21 23:11:46 UTC) #36
Alexei Svitkine (slow)
LGTM with one last round of nits below: https://codereview.chromium.org/14923004/diff/110001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/110001/chrome/browser/app_controller_mac.mm#newcode222 chrome/browser/app_controller_mac.mm:222: // ...
7 years, 6 months ago (2013-06-22 14:14:09 UTC) #37
noms (inactive)
+ nico for owners stamp on: chrome/browser/app_controller_mac.h chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac_unittest.mm
7 years, 6 months ago (2013-06-25 19:05:19 UTC) #38
Alexei Svitkine (slow)
(Don't forget to address my nits above too.) On Tue, Jun 25, 2013 at 3:05 ...
7 years, 6 months ago (2013-06-25 19:15:17 UTC) #39
Nico
lgtm re CL description: `git log` doesn't wrap CL descriptions so try to keep lines ...
7 years, 6 months ago (2013-06-25 19:20:20 UTC) #40
noms
https://codereview.chromium.org/14923004/diff/110001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/14923004/diff/110001/chrome/browser/app_controller_mac.mm#newcode201 chrome/browser/app_controller_mac.mm:201: : profile_manager_(profile_manager), On 2013/06/25 19:20:20, Nico wrote: > nit: ...
7 years, 5 months ago (2013-06-26 15:24:44 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/14923004/129002
7 years, 5 months ago (2013-06-26 17:49:10 UTC) #42
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 5 months ago (2013-06-26 18:13:17 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/14923004/129002
7 years, 5 months ago (2013-06-27 13:52:05 UTC) #44
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 5 months ago (2013-06-27 14:07:04 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/14923004/156001
7 years, 5 months ago (2013-06-27 14:54:12 UTC) #46
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=130467
7 years, 5 months ago (2013-06-27 16:27:56 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/14923004/180001
7 years, 5 months ago (2013-06-27 18:48:12 UTC) #48
commit-bot: I haz the power
7 years, 5 months ago (2013-06-28 00:15:02 UTC) #49
Message was sent while issue was closed.
Change committed as 209035

Powered by Google App Engine
This is Rietveld 408576698