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

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

Issue 2698683002: Forced ephemeral profile deletion on browser removal crash fix. (Closed)
Patch Set: Fixed comment. 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) {
Mike Lerman 2017/03/01 14:24:29 If this is supposed to only be used for Ephemeral
palar 2017/03/01 16:51:44 It would be an overkill, but hey, why not.
+ FinishDeletingProfile(profile_dir, GenerateNextProfileDirectoryPath());
+}
+
#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.
Mike Lerman 2017/03/01 14:24:29 We're skipping the call to BrowserList::CloseAllBr
palar 2017/03/01 16:51:44 This call happened only on last browser with this
Mike Lerman 2017/03/01 17:44:30 Ok. If we're not going to make sure programmatical
palar 2017/03/01 19:11:22 DCHECK I can do.
- 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