Chromium Code Reviews| Index: chrome/browser/lifetime/application_lifetime.cc |
| diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc |
| index 503a0740226713866267851e18ad0b8dec5db6e2..1f0d5e88815945b7dd69fb051e6d7f5e5e4f913b 100644 |
| --- a/chrome/browser/lifetime/application_lifetime.cc |
| +++ b/chrome/browser/lifetime/application_lifetime.cc |
| @@ -7,6 +7,7 @@ |
| #include "ash/shell.h" |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| +#include "base/debug/trace_event.h" |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/message_loop/message_loop.h" |
| @@ -125,6 +126,7 @@ void CloseAllBrowsers() { |
| void AttemptUserExit() { |
|
DaveMoore
2013/09/03 17:02:48
Why can't you always start shutdown tracing here?
Mr4D (OOO till 08-26)
2013/09/03 17:34:34
As you have said yourself:
On other OS'ses then Ch
DaveMoore
2013/09/03 20:24:11
I would want that info in the trace, and then abor
|
| #if defined(OS_CHROMEOS) |
| + StartShutdownTracing(); |
| chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); |
| // Write /tmp/uptime-logout-started as well. |
| const char kLogoutStarted[] = "logout-started"; |
| @@ -138,6 +140,7 @@ void AttemptUserExit() { |
| state->GetString(prefs::kApplicationLocale) != owner_locale && |
| !state->IsManagedPreference(prefs::kApplicationLocale)) { |
| state->SetString(prefs::kApplicationLocale, owner_locale); |
| + TRACE_EVENT0("shutdown", "CommitPendingWrite"); |
| state->CommitPendingWrite(); |
| } |
| } |
| @@ -154,6 +157,18 @@ void AttemptUserExit() { |
| #endif |
| } |
| +void StartShutdownTracing() { |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + if (command_line.HasSwitch(switches::kTraceShutdown)) { |
| + base::debug::CategoryFilter category_filter( |
| + command_line.GetSwitchValueASCII(switches::kTraceShutdown)); |
| + base::debug::TraceLog::GetInstance()->SetEnabled( |
| + category_filter, |
| + base::debug::TraceLog::RECORD_UNTIL_FULL); |
| + } |
| + TRACE_EVENT0("shutdown", "AttemptUserExit"); |
| +} |
| + |
| // The Android implementation is in application_lifetime_android.cc |
| #if !defined(OS_ANDROID) |
| void AttemptRestart() { |