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

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, 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 611ff39f0caaf1a7897e3ae63d780c622f2e77c8..58235fa5a5bbca0e3aab1c4b647d004b9aed6ac2 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1082,29 +1082,8 @@ void ChromeBrowserMainParts::PreProfileInit() {
// creation.
feedback::FeedbackProfileObserver::Initialize();
- ProfileManager* profile_manager = g_browser_process->profile_manager();
-
- // First check if any ephemeral profiles are left behind because of browser
- // crash and schedule them for deletion and then proceed with getting the set
- // of profiles to open.
- ProfileInfoCache& profile_cache = profile_manager->GetProfileInfoCache();
- size_t profiles_count = profile_cache.GetNumberOfProfiles();
- std::vector<base::FilePath> profiles_to_delete;
- for (size_t i = 0; i < profiles_count; ++i) {
- if (profile_cache.ProfileIsEphemeralAtIndex(i))
- 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(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&ProfileManager::CleanUpStaleProfiles, profiles_to_delete));
- }
+ // Ephemeral profiles may have been left behind if the browser crashed.
+ g_browser_process->profile_manager()->CleanUpEphemeralProfiles();
#endif // !defined(OS_ANDROID)
#if defined(ENABLE_EXTENSIONS)
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698