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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 50293011: Improve ephemeral profiles clean up code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed param. Created 7 years, 1 month 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_impl.cc » ('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 7c341da961a6d68209eac6a1441ad6aba9cca355..b12102db4a11b83b16ef081b5f2ce265ab8052ea 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1042,9 +1042,16 @@ void ChromeBrowserMainParts::PreProfileInit() {
if (profile_cache.ProfileIsEphemeralAtIndex(i))
profiles_to_delete.push_back(profile_cache.GetPathOfProfileAtIndex(i));
}
- for (size_t i = 0;i < profiles_to_delete.size(); ++i) {
- profile_manager->ScheduleProfileForDeletion(
- profiles_to_delete[i], ProfileManager::CreateCallback());
+
+ 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));
}
#endif // OS_ANDROID
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698