Commit 8549a432 authored by kylechar's avatar kylechar Committed by Commit Bot

RELAND: Ozone X11 check X display on initialization.

Add a CHECK that XOpenDisplay() doesn't return null when initializing
Ozone X11. There is no point going any further, we are going to crash
somewhere else and the crash stack isn't going to be as obvious.

Original change in https://crrev.com/c/980596. Reland change with call
to XInitThreaded() first still to avoid crashes.

Bug: 806508
Change-Id: I0ca480b140da702946b4b75cd93c63cd388fdfca
Reviewed-on: https://chromium-review.googlesource.com/997894Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548754}
parent ae91114f
...@@ -108,15 +108,18 @@ class OzonePlatformX11 : public OzonePlatform { ...@@ -108,15 +108,18 @@ class OzonePlatformX11 : public OzonePlatform {
private: private:
// Performs initialization steps need by both UI and GPU. // Performs initialization steps need by both UI and GPU.
void InitializeCommon(const InitParams& params) { void InitializeCommon(const InitParams& params) {
// TODO(kylechar): Add DCHECK we only enter InitializeCommon() twice for
// single process mode.
if (common_initialized_) if (common_initialized_)
return; return;
// Always initialze in multi-thread mode, since this is used only during // Always initialize in multi-thread mode, since this is used only during
// development. // development.
XInitThreads(); XInitThreads();
// If XOpenDisplay() failed there is nothing we can do. Crash here instead
// of crashing later. If you are crashing here, make sure there is an X
// server running and $DISPLAY is set.
CHECK(gfx::GetXDisplay()) << "Missing X server or $DISPLAY";
ui::SetDefaultX11ErrorHandlers(); ui::SetDefaultX11ErrorHandlers();
common_initialized_ = true; common_initialized_ = true;
......
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