| Index: chrome/browser/browser_shutdown.cc
|
| diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
|
| index 4af6c31b616b2c4205cb17d72e21bb679a6d0baf..7e7b39f185243acc8dceea75338581cc03aeb6b9 100644
|
| --- a/chrome/browser/browser_shutdown.cc
|
| +++ b/chrome/browser/browser_shutdown.cc
|
| @@ -170,14 +170,7 @@ bool ShutdownPreThreadsStop() {
|
| if (metrics)
|
| metrics->RecordCompletedSessionEnd();
|
|
|
| - 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.
|
| - prefs->SetInteger(prefs::kShutdownType, g_shutdown_type);
|
| - prefs->SetInteger(prefs::kShutdownNumProcesses, g_shutdown_num_processes);
|
| - prefs->SetInteger(prefs::kShutdownNumProcessesSlow,
|
| - g_shutdown_num_processes_slow);
|
| - }
|
| + RecordShutdownInfoPrefs();
|
|
|
| // Check local state for the restart flag so we can restart the session below.
|
| bool restart_last_session = false;
|
| @@ -198,6 +191,18 @@ bool ShutdownPreThreadsStop() {
|
| return restart_last_session;
|
| }
|
|
|
| +void RecordShutdownInfoPrefs() {
|
| + if (g_shutdown_type > NOT_VALID && g_shutdown_num_processes > 0) {
|
| + PrefService* prefs = g_browser_process->local_state();
|
| + // Record the shutdown info so that we can put it into a histogram at next
|
| + // startup.
|
| + prefs->SetInteger(prefs::kShutdownType, g_shutdown_type);
|
| + prefs->SetInteger(prefs::kShutdownNumProcesses, g_shutdown_num_processes);
|
| + prefs->SetInteger(prefs::kShutdownNumProcessesSlow,
|
| + g_shutdown_num_processes_slow);
|
| + }
|
| +}
|
| +
|
| void ShutdownPostThreadsStop(int shutdown_flags) {
|
| delete g_browser_process;
|
| g_browser_process = NULL;
|
| @@ -327,6 +332,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,
|
|
|