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

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

Issue 1869473002: Fixed crash on double profile delete operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: param renaming. 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 9a0ed359e027b479444f1de4e679df58d4132974..56fd767c46caa54b99699118168ac54d08839c08 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -726,10 +726,22 @@ ProfileShortcutManager* ProfileManager::profile_shortcut_manager() {
}
#if !defined(OS_ANDROID)
+bool ProfileManager::MaybeScheduleProfileForDeletion(
+ const base::FilePath& profile_dir,
+ const CreateCallback& callback,
+ ProfileMetrics::ProfileDelete deletion_source) {
+ if (IsProfileMarkedForDeletion(profile_dir))
+ return false;
+ ScheduleProfileForDeletion(profile_dir, callback);
+ ProfileMetrics::LogProfileDeleteUser(deletion_source);
+ return true;
+}
+
void ProfileManager::ScheduleProfileForDeletion(
const base::FilePath& profile_dir,
const CreateCallback& callback) {
DCHECK(profiles::IsMultipleProfilesEnabled());
+ DCHECK(!IsProfileMarkedForDeletion(profile_dir));
// Cancel all in-progress downloads before deleting the profile to prevent a
// "Do you want to exit Google Chrome and cancel the downloads?" prompt
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698