mash: Cleanly exit on SIGTERM, SIGINT, SIGHUP
This is needed for the Chrome OS session_manager to cleanly shutdown chrome
on device shutdown and in tests. It's also useful on Linux desktop to cleanly
exit chrome in response to control-C.
* Refactor ShutdownDetector and signal handlers out of
ChromeBrowserMainPartsPosix. Make it run a shutdown callback.
* Use shutdown callback to exit the chrome --mash root process run loop.
BUG=697146,692227,696696
TEST=stop ui closes chrome quickly, session_manager doesn't send signal 9
anymore, control-C on Linux desktop cleanly exists chrome
Review-Url: https://codereview.chromium.org/2729633002
Cr-Commit-Position: refs/heads/master@{#454163}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 757c542..e930025 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2344,6 +2344,9 @@
if (use_aura && !use_ozone && is_desktop_linux) {
deps += [ "//chrome/browser/ui/libgtkui" ]
}
+ if (is_posix) {
+ deps += [ "//chrome/app:shutdown_signal_handlers" ]
+ }
if (is_posix && !is_mac) {
sources += [
"//chrome/app/chrome_crash_reporter_client.cc",