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

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

Issue 2698683002: Forced ephemeral profile deletion on browser removal crash fix. (Closed)
Patch Set: Created 3 years, 10 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 2735519ad44c3de93ba549f0c84a1cfce7d33e00..09859b0c7a70b5f85bf27ab388b0ba7739974cfb 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -812,6 +812,12 @@ void ProfileManager::ScheduleProfileForDeletion(
EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir);
}
}
+
+void ProfileManager::ScheduleForcedEphemeralProfileForDeletion(
+ const base::FilePath& profile_dir) {
+ FinishDeletingProfile(profile_dir, GenerateNextProfileDirectoryPath());
Bernhard Bauer 2017/02/15 18:03:30 Just to confirm: This updates the last used profil
palar 2017/02/16 10:39:04 Exacly. Upon browser start a new profile at the sp
+}
+
#endif // !defined(OS_ANDROID)
void ProfileManager::AutoloadProfiles() {
@@ -1666,8 +1672,8 @@ void ProfileManager::BrowserListObserver::OnBrowserRemoved(
// Do nothing if the profile is already being deleted.
} else if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) {
// Delete if the profile is an ephemeral profile.
- g_browser_process->profile_manager()->ScheduleProfileForDeletion(
- path, ProfileManager::CreateCallback());
+ g_browser_process->profile_manager()
+ ->ScheduleForcedEphemeralProfileForDeletion(path);
} else {
#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS)
// Gather statistics and store into ProfileInfoCache. For incognito profile
« chrome/browser/profiles/profile_manager.h ('K') | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698