Chromium Code Reviews| Index: chrome/browser/browser_shutdown.cc |
| diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc |
| index aa7486c24e5ce6d29234c06e19b4d5880705bb84..c7ebc6ce5a1656a6b852f5e43c67948fdda6ca8e 100644 |
| --- a/chrome/browser/browser_shutdown.cc |
| +++ b/chrome/browser/browser_shutdown.cc |
| @@ -19,6 +19,7 @@ |
| #include "base/strings/stringprintf.h" |
| #include "base/threading/thread.h" |
| #include "base/time/time.h" |
| +#include "base/trace_event/trace_event.h" |
| #include "chrome/browser/about_flags.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/lifetime/application_lifetime.h" |
| @@ -30,6 +31,7 @@ |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/switch_utils.h" |
| #include "components/metrics/metrics_service.h" |
| +#include "components/tracing/tracing_switches.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/render_process_host.h" |
| @@ -112,7 +114,7 @@ void OnShutdownStarting(ShutdownType type) { |
| #if !defined(OS_CHROMEOS) |
| // Start the shutdown tracing. Note that On ChromeOS this has already been |
| // called in AttemptUserExit(). |
| - chrome::StartShutdownTracing(); |
| + browser_shutdown::StartShutdownTracing(); |
|
sky
2015/10/07 17:12:32
Isn't this code in the browser_shutdown namespace?
Lei Zhang
2015/10/08 07:01:58
Done.
|
| #endif |
| g_shutdown_type = type; |
| @@ -346,4 +348,17 @@ bool IsTryingToQuit() { |
| return g_trying_to_quit; |
| } |
| +void StartShutdownTracing() { |
| + const base::CommandLine& command_line = |
| + *base::CommandLine::ForCurrentProcess(); |
| + if (command_line.HasSwitch(switches::kTraceShutdown)) { |
| + base::trace_event::TraceConfig trace_config( |
| + command_line.GetSwitchValueASCII(switches::kTraceShutdown), ""); |
| + base::trace_event::TraceLog::GetInstance()->SetEnabled( |
| + trace_config, |
| + base::trace_event::TraceLog::RECORDING_MODE); |
| + } |
| + TRACE_EVENT0("shutdown", "StartShutdownTracing"); |
| +} |
| + |
| } // namespace browser_shutdown |