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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 2021253002: Skip profiles in GetLastOpenedProfiles that fail to initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the bad DCHECK, updated comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 93a514c661c5c7ff8c884352d77100a423ca809f..dfe1b645bd5b0340faaed56bdbbbe2382b8a850f 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -622,7 +622,9 @@ std::vector<Profile*> ProfileManager::GetLastOpenedProfiles(
LOG(WARNING) << "Invalid entry in " << prefs::kProfilesLastActive;
continue;
}
- to_return.push_back(GetProfile(user_data_dir.AppendASCII(profile)));
+ Profile* profile = GetProfile(user_data_dir.AppendASCII(profile));
+ if (profile)
+ to_return.push_back(profile);
}
}
return to_return;
@@ -1338,7 +1340,6 @@ Profile* ProfileManager::CreateAndInitializeProfile(
// which would make Bad Things happen if we returned it.
CHECK(!GetProfileByPathInternal(profile_dir));
Profile* profile = CreateProfileHelper(profile_dir);
- DCHECK(profile);
if (profile) {
bool result = AddProfile(profile);
Peter Kasting 2016/05/31 19:12:30 Nit: You don't need to do this in this change, but
WC Leung 2016/06/01 18:56:55 You're right. Anyway the code here is having an ag
DCHECK(result);

Powered by Google App Engine
This is Rietveld 408576698