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

Unified Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 2318373003: Record shutdown type UMA (Closed)
Patch Set: Record shutdown type UMA Created 4 years, 3 months 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
Index: chrome/browser/lifetime/application_lifetime.cc
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc
index d7d2e58089f28c607e51c4a941908729bf25c8d8..b0ebd004e1a1ac8e1345e0881aab12a5613e5b0d 100644
--- a/chrome/browser/lifetime/application_lifetime.cc
+++ b/chrome/browser/lifetime/application_lifetime.cc
@@ -307,6 +307,14 @@ void SessionEnding() {
browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION);
+ // In a clean shutdown, browser_shutdown::OnShutdownStarting sets
+ // g_shutdown_type, and browser_shutdown::ShutdownPreThreadsStop updates the
+ // pref with the value. However, here the process is going to exit without
+ // calling ShutdownPreThreadsStop.
+ // Instead, here we update the pref to record the shutdown info.
+ g_browser_process->local_state()->SetInteger(prefs::kShutdownType,
sky 2016/09/09 15:40:56 There is a bunch of other stuff ShutdownPreThreads
hashimoto 2016/09/12 05:10:19 Added a new function RecordShutdownInfoPrefs to br
+ browser_shutdown::END_SESSION);
+
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
content::NotificationService::AllSources(),

Powered by Google App Engine
This is Rietveld 408576698