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

Unified Diff: chrome/browser/browser_shutdown.cc

Issue 1388303002: Move assorted function in application_lifetime to where they are used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/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

Powered by Google App Engine
This is Rietveld 408576698