Commit feee9990 authored by Tom Anderson's avatar Tom Anderson Committed by Chromium LUCI CQ

Gracefully shutdown if display server dies on desktop Linux

On Linux, the display server closes when the session is ending.  In
particular, for X11 connections, the server may be remote, so the
connection can go down at any time.  [1] added a crash on connection
IO errors where it would previously gracefully exit.  This is desirable
on ChromeOS to generate crash reports, but not for desktop Linux, so
this CL restores the old behavior on Linux.

[1] https://chromium.googlesource.com/chromium/src/+/59a4564762df2b3cb5a6037d5ce97e5ad626eb48

R=rjkroege
BUG=1160140

Change-Id: Ie5a5ce762e6b65f533411ce88caa51d3c27366a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600045
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840661}
parent 92bc3e2c
...@@ -32,9 +32,13 @@ void ChromeBrowserMainExtraPartsOzone::PreEarlyInitialization() { ...@@ -32,9 +32,13 @@ void ChromeBrowserMainExtraPartsOzone::PreEarlyInitialization() {
} }
void ChromeBrowserMainExtraPartsOzone::PostMainMessageLoopStart() { void ChromeBrowserMainExtraPartsOzone::PostMainMessageLoopStart() {
auto shutdown_cb = base::BindOnce([](){ auto shutdown_cb = base::BindOnce([] {
#if BUILDFLAG(IS_LACROS)
// Force a crash so that a crash report is generated. // Force a crash so that a crash report is generated.
LOG(FATAL) << "Wayland protocol error."; LOG(FATAL) << "Wayland protocol error.";
#else
chrome::SessionEnding();
#endif
}); });
#if defined(USE_OZONE) #if defined(USE_OZONE)
if (features::IsUsingOzonePlatform()) { if (features::IsUsingOzonePlatform()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment