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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 1428973003: Utilize ProfileInfoCache to support data type counts in profile deletion flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added storing to ProfileInfoCache at startup after a non-normal shutdown Created 5 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 | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_statistics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_statistics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698