Index: chrome/browser/browser_shutdown.cc |
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc |
index 4af6c31b616b2c4205cb17d72e21bb679a6d0baf..7fb5343f4cf496deee2721f6d281210478d747cc 100644 |
--- a/chrome/browser/browser_shutdown.cc |
+++ b/chrome/browser/browser_shutdown.cc |
@@ -170,6 +170,21 @@ bool ShutdownPreThreadsStop() { |
if (metrics) |
metrics->RecordCompletedSessionEnd(); |
+ bool restart_last_session = RecordShutdownInfoPrefs(); |
+ |
+ prefs->CommitPendingWrite(); |
+ |
+#if defined(ENABLE_RLZ) |
+ // Cleanup any statics created by RLZ. Must be done before NotificationService |
+ // is destroyed. |
+ rlz::RLZTracker::CleanupRlz(); |
+#endif |
+ |
+ return restart_last_session; |
+} |
+ |
+bool RecordShutdownInfoPrefs() { |
+ PrefService* prefs = g_browser_process->local_state(); |
if (g_shutdown_type > NOT_VALID && g_shutdown_num_processes > 0) { |
// Record the shutdown info so that we can put it into a histogram at next |
// startup. |
@@ -179,22 +194,13 @@ bool ShutdownPreThreadsStop() { |
g_shutdown_num_processes_slow); |
} |
- // Check local state for the restart flag so we can restart the session below. |
+ // Check local state for the restart flag so we can restart the session later. |
bool restart_last_session = false; |
if (prefs->HasPrefPath(prefs::kRestartLastSessionOnShutdown)) { |
restart_last_session = |
prefs->GetBoolean(prefs::kRestartLastSessionOnShutdown); |
prefs->ClearPref(prefs::kRestartLastSessionOnShutdown); |
} |
- |
- prefs->CommitPendingWrite(); |
- |
-#if defined(ENABLE_RLZ) |
- // Cleanup any statics created by RLZ. Must be done before NotificationService |
- // is destroyed. |
- rlz::RLZTracker::CleanupRlz(); |
-#endif |
- |
return restart_last_session; |
} |
@@ -327,6 +333,8 @@ void ReadLastShutdownInfo() { |
prefs->SetInteger(prefs::kShutdownNumProcesses, 0); |
prefs->SetInteger(prefs::kShutdownNumProcessesSlow, 0); |
+ UMA_HISTOGRAM_ENUMERATION("Shutdown.ShutdownType", type, kNumShutdownTypes); |
+ |
// Read and delete the file on the file thread. |
BrowserThread::PostTask( |
BrowserThread::FILE, FROM_HERE, |