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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1113333003: Don't create a new profile when cleaning up stale ephemeral profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fix? Created 5 years, 8 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/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index f6b138f5dfa30fefcfe83ad782a8547091fd9a34..65bd9843246fe1da484aaacad461bb07bf0cf343 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -234,6 +234,14 @@ using content::BrowserThread;
namespace {
+#if !defined(OS_ANDROID)
+// Asserts in debug builds that we don't create a new profile when cleaning up
+// stale ephemeral profiles.
+void DidCreateProfile(Profile* profile, Profile::CreateStatus status) {
+ NOTREACHED();
+}
+#endif // !defined(OS_ANDROID)
+
// This function provides some ways to test crash and assertion handling
// behavior of the program.
void HandleTestParameters(const base::CommandLine& command_line) {
@@ -1092,15 +1100,10 @@ void ChromeBrowserMainParts::PreProfileInit() {
profiles_to_delete.push_back(profile_cache.GetPathOfProfileAtIndex(i));
}
- if (profiles_to_delete.size()) {
- for (size_t i = 0; i < profiles_to_delete.size(); ++i) {
- profile_manager->ScheduleProfileForDeletion(
- profiles_to_delete[i], ProfileManager::CreateCallback());
- }
- // Clean up stale profiles immediately after browser start.
- BrowserThread::PostTask(
Mike Lerman 2015/05/05 13:44:45 Why is CleanUpStaleProfiles no longer necessary? I
Bernhard Bauer 2015/05/05 14:33:21 It already did that before (in FinishDeletingProfi
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&ProfileManager::CleanUpStaleProfiles, profiles_to_delete));
+ for (size_t i = 0; i < profiles_to_delete.size(); ++i) {
Mike Lerman 2015/05/05 13:44:45 Can you put a comment above profiles_to_delete tha
Bernhard Bauer 2015/05/05 14:33:21 Done.
+ profile_manager->ScheduleProfileForDeletion(
+ profiles_to_delete[i], true /* suppress_profile_creation */,
+ base::Bind(&DidCreateProfile));
Mike Lerman 2015/05/05 13:44:45 I think you can just put a ProfileManager::CreateC
Bernhard Bauer 2015/05/05 14:33:21 Done.
}
#endif // !defined(OS_ANDROID)

Powered by Google App Engine
This is Rietveld 408576698