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

Unified Diff: chrome/app/shutdown_signal_handlers_posix.h

Issue 2729633002: mash: Cleanly exit on SIGTERM, SIGINT, SIGHUP (Closed)
Patch Set: Created 3 years, 10 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/app/shutdown_signal_handlers_posix.h
diff --git a/chrome/app/shutdown_signal_handlers_posix.h b/chrome/app/shutdown_signal_handlers_posix.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a9384c28bc97c494a7864ead3f6ca828eac8964
--- /dev/null
+++ b/chrome/app/shutdown_signal_handlers_posix.h
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_APP_SHUTDOWN_SIGNAL_HANDLERS_POSIX_H_
+#define CHROME_APP_SHUTDOWN_SIGNAL_HANDLERS_POSIX_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+// Runs a background thread that installs signal handlers to watch for shutdown
+// signals like SIGTERM, SIGINT and SIGTERM. |shutdown_callback| is invoked on
+// |task_runner| which is usually the main thread's task runner.
+void InstallShutdownSignalHandlers(
+ const base::Closure& shutdown_callback,
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+
+#endif // CHROME_APP_SHUTDOWN_SIGNAL_HANDLERS_POSIX_H_

Powered by Google App Engine
This is Rietveld 408576698