| 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
|
|
|
|
|