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

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: rebase 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
« no previous file with comments | « chrome/browser/browser_shutdown.h ('k') | chrome/browser/lifetime/application_lifetime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_shutdown.cc
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index aa7486c24e5ce6d29234c06e19b4d5880705bb84..3e28ea2df71d4bf54d73603cf54b62f90c27e5e4 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();
+ StartShutdownTracing();
#endif
g_shutdown_type = type;
@@ -218,7 +220,7 @@ void ShutdownPostThreadsStop(bool restart_last_session) {
#if defined(OS_WIN)
if (!browser_util::IsBrowserAlreadyRunning() &&
- g_shutdown_type != browser_shutdown::END_SESSION) {
+ g_shutdown_type != END_SESSION) {
upgrade_util::SwapNewChromeExeIfPresent();
}
#endif
@@ -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
« no previous file with comments | « chrome/browser/browser_shutdown.h ('k') | chrome/browser/lifetime/application_lifetime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698