Index: chrome/browser/profiles/profile_manager.cc |
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
index 83f58c7e590c2489922e026e12ba6aa1c0bd3d07..6317da8470b4eb718600ef8abdbc5839af61dbae 100644 |
--- a/chrome/browser/profiles/profile_manager.cc |
+++ b/chrome/browser/profiles/profile_manager.cc |
@@ -38,6 +38,7 @@ |
#include "chrome/browser/profiles/profile_destroyer.h" |
#include "chrome/browser/profiles/profile_info_cache.h" |
#include "chrome/browser/profiles/profile_metrics.h" |
+#include "chrome/browser/profiles/profile_statistics.h" |
#include "chrome/browser/profiles/profiles_state.h" |
#include "chrome/browser/signin/account_fetcher_service_factory.h" |
#include "chrome/browser/signin/account_reconcilor_factory.h" |
@@ -1051,6 +1052,12 @@ void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) { |
chrome::NOTIFICATION_PROFILE_ADDED, |
content::Source<Profile>(profile), |
content::NotificationService::NoDetails()); |
+ |
+ // Record statistics to ProfileInfoCache if not a normal shutdown. |
+ if (!profile->IsGuestSession() && !profile->IsSystemProfile() && |
+ !profile->IsNewProfile() && !go_off_the_record && |
+ profile->GetLastSessionExitType() != Profile::EXIT_NORMAL) |
+ profiles::StoreProfileStatisticsToCache(profile); |
lwchkg
2015/11/08 15:45:58
This is causing Chromium to crash if the exit type
lwchkg
2015/11/09 21:00:09
Found the reason of crash: attempting to access th
Mike Lerman
2015/11/10 15:45:44
Some of the services you're looking at may be init
lwchkg
2015/11/10 18:11:07
Thanks. I've checked the services, and it looks li
|
} |
void ProfileManager::DoFinalInitForServices(Profile* profile, |
@@ -1449,6 +1456,9 @@ void ProfileManager::BrowserListObserver::OnBrowserRemoved( |
return; |
} |
+ // Store statistics into ProfileInfoCache. |
+ profiles::StoreProfileStatisticsToCache(profile); |
+ |
// If the last browser of a profile that is scheduled for deletion is closed |
// do that now. |
base::FilePath path = profile->GetPath(); |