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

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

Issue 336603002: Add CHECK for rare ChromeLauncherController crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 3634ad4bb03f270a7b370813de0f5e77ab6fc39e..3e8dcbada89ff6fc41f2fa036206b7ee85487164 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -342,8 +342,16 @@ Profile* ProfileManager::GetActiveUserProfile() {
if (user && user->is_profile_created())
return manager->GetProfileByUser(user);
#endif
- return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath(
- profile_manager->user_data_dir());
+ Profile* profile =
+ profile_manager->GetActiveUserOrOffTheRecordProfileFromPath(
+ profile_manager->user_data_dir());
+ // |profile| could be null if the user doesn't have a profile yet and the path
+ // is on a read-only volume (preventing Chrome from making a new one).
+ // However, most callers of this function immediately dereference the result
+ // which would lead to crashes in a variety of call sites. Assert here to
+ // figure out how common this is. http://crbug.com/383019
+ CHECK(profile) << profile_manager->user_data_dir().AsUTF8Unsafe();
+ return profile;
}
Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698