Chromium Code Reviews| 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..87425693948fb27f1334156efc65fbd235c0f76e 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -202,6 +202,8 @@ using content::BrowserThread; |
| namespace { |
| +const int64 kEphemeralProfilesCleanUpDelaySec = 10; |
| + |
| // This function provides some ways to test crash and assertion handling |
| // behavior of the program. |
| void HandleTestParameters(const CommandLine& command_line) { |
| @@ -1042,9 +1044,18 @@ 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 the profiles soon after browser start, but not immediately not |
| + // to delay browser start-up. |
|
rpetterson
2013/11/04 18:18:59
Was there noticeable slow down for startup without
pastarmovj
2013/11/05 08:58:17
To be honest I have never tried. Since I need to p
jochen (gone - plz use gerrit)
2013/11/05 13:03:25
I don't think we should do that, unless you have d
pastarmovj
2013/11/05 16:11:02
After discussing this with Jochen. I can see the p
|
| + BrowserThread::PostDelayedTask( |
| + BrowserThread::FILE, FROM_HERE, |
| + base::Bind(&ProfileManager::CleanUpStaleProfiles, profiles_to_delete), |
| + base::TimeDelta::FromSeconds(kEphemeralProfilesCleanUpDelaySec)); |
| } |
| #endif // OS_ANDROID |