mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1923086 [Wayland] Set compositor crash handler r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D224926
This commit is contained in:
parent
254711f85b
commit
c51049416a
@ -4751,6 +4751,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
|
||||
if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) {
|
||||
auto* proxyLog = getenv("WAYLAND_PROXY_LOG");
|
||||
WaylandProxy::SetVerbose(proxyLog && *proxyLog);
|
||||
WaylandProxy::SetCompositorCrashHandler(WlCompositorCrashHandler);
|
||||
gWaylandProxy = WaylandProxy::Create();
|
||||
if (gWaylandProxy) {
|
||||
gWaylandProxy->RunThread();
|
||||
|
@ -523,6 +523,13 @@ static void WlLogHandler(const char* format, va_list args) {
|
||||
MOZ_CRASH_UNSAFE(error);
|
||||
}
|
||||
|
||||
// TODO: Add compositor info
|
||||
void WlCompositorCrashHandler() {
|
||||
constexpr char error[] = "Compositor crashed";
|
||||
gfxCriticalNote << "Wayland protocol error: " << error;
|
||||
MOZ_CRASH_UNSAFE(error);
|
||||
}
|
||||
|
||||
nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay)
|
||||
: mThreadId(PR_GetCurrentThread()), mDisplay(aDisplay) {
|
||||
// GTK sets the log handler on display creation, thus we overwrite it here
|
||||
|
@ -120,6 +120,7 @@ class nsWaylandDisplay {
|
||||
wl_display* WaylandDisplayGetWLDisplay();
|
||||
nsWaylandDisplay* WaylandDisplayGet();
|
||||
void WaylandDisplayRelease();
|
||||
void WlCompositorCrashHandler();
|
||||
|
||||
} // namespace mozilla::widget
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user