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

Issue 929073002: Only return fully initialized profiles in ProfileManager::GetProfileByPath. (Closed)

Created:
5 years, 10 months ago by Bernhard Bauer
Modified:
5 years, 10 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, rginda+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Only return fully initialized profiles in ProfileManager::GetProfileByPath. When a profile was loaded asynchronously, ProfileManager::GetProfileByPath could return it before it had been fully initialized, which could lead to... interesting problems. We now return null if that is the case, because callers of GetProfileByPath need to deal with a null return value anyway. ProfileManager::GetProfile (which is supposed to create the profile synchronously if it doesn't exist) will now DCHECK when trying to get a profile that is not fully initialized. This CL also stops AppController from trying to get a profile that has just been deleted, which would now crash otherwise. BUG=425785 Committed: https://crrev.com/773470007a411cff16492cae579b91649d5ee8b5 Cr-Commit-Position: refs/heads/master@{#317298}

Patch Set 1 #

Patch Set 2 : sync #

Patch Set 3 : x #

Patch Set 4 : fix #

Patch Set 5 : fix? #

Patch Set 6 : cleanup #

Patch Set 7 : DCHECK #

Total comments: 2

Patch Set 8 : review #

Patch Set 9 : sync #

Patch Set 10 : cleanup #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -21 lines) Patch
M chrome/browser/app_controller_mac.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/app_controller_mac.mm View 1 2 3 2 chunks +5 lines, -9 lines 0 comments Download
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 6 7 8 4 chunks +17 lines, -7 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 5 chunks +18 lines, -4 lines 2 comments Download

Messages

Total messages: 25 (9 generated)
Bernhard Bauer
Please review. Thanks!
5 years, 10 months ago (2015-02-17 12:00:16 UTC) #4
Bernhard Bauer
On 2015/02/17 12:00:16, Bernhard Bauer wrote: > Please review. Thanks! (And by that, I meant ...
5 years, 10 months ago (2015-02-17 18:01:07 UTC) #5
Robert Sesek
Mac bits LGTM
5 years, 10 months ago (2015-02-17 19:19:05 UTC) #6
Bernhard Bauer
Monica, ping? I'm willing to bribe you with cute pictures (e.g. http://i.imgur.com/MdNdNEq.jpg).
5 years, 10 months ago (2015-02-18 21:00:04 UTC) #7
noms (inactive)
https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode387 chrome/browser/profiles/profile_manager.cc:387: DCHECK(!GetProfileByPathInternal(profile_dir)); Hmm, so in non-debug world, if the profile ...
5 years, 10 months ago (2015-02-18 21:26:21 UTC) #8
Bernhard Bauer
On Wed, Feb 18, 2015, 21:26 null <noms@chromium.org> wrote: https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode387 <https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode387chrome/browser/profiles/profile_manager.cc:387> ...
5 years, 10 months ago (2015-02-18 22:51:31 UTC) #9
Bernhard Bauer
Gah, Inbox hates me. What I wanted to say was: Should I make it a ...
5 years, 10 months ago (2015-02-18 22:54:31 UTC) #10
Bernhard Bauer
https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/929073002/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode387 chrome/browser/profiles/profile_manager.cc:387: DCHECK(!GetProfileByPathInternal(profile_dir)); On 2015/02/18 21:26:21, Monica Dinculescu wrote: > Hmm, ...
5 years, 10 months ago (2015-02-19 10:22:37 UTC) #12
noms (inactive)
ok. i think this makes sense. profiles lgtm!
5 years, 10 months ago (2015-02-19 23:42:00 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/929073002/140001
5 years, 10 months ago (2015-02-20 08:49:32 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/44152)
5 years, 10 months ago (2015-02-20 09:07:10 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/929073002/180001
5 years, 10 months ago (2015-02-20 11:19:28 UTC) #20
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 10 months ago (2015-02-20 12:20:29 UTC) #21
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/773470007a411cff16492cae579b91649d5ee8b5 Cr-Commit-Position: refs/heads/master@{#317298}
5 years, 10 months ago (2015-02-20 12:22:01 UTC) #22
Pam (message me for reviews)
LGTM, one optional nit https://codereview.chromium.org/929073002/diff/180001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/929073002/diff/180001/chrome/browser/profiles/profile_manager.cc#newcode565 chrome/browser/profiles/profile_manager.cc:565: return profile_info && profile_info->created ? ...
5 years, 10 months ago (2015-02-23 12:02:02 UTC) #24
Bernhard Bauer
5 years, 10 months ago (2015-02-23 18:42:14 UTC) #25
Message was sent while issue was closed.
https://codereview.chromium.org/929073002/diff/180001/chrome/browser/profiles...
File chrome/browser/profiles/profile_manager.cc (right):

https://codereview.chromium.org/929073002/diff/180001/chrome/browser/profiles...
chrome/browser/profiles/profile_manager.cc:565: return profile_info &&
profile_info->created ? profile_info->profile.get()
On 2015/02/23 12:02:02, Pam (also PM for reviews) wrote:
> nit: This would be slightly clearer with the condition parenthesized.

Done (in https://codereview.chromium.org/953453002).

Powered by Google App Engine
This is Rietveld 408576698