diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 19:24:38 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 19:24:38 +0000 |
commit | 8368f194019805e5cca637e2b94d78ac9724d29d (patch) | |
tree | 1a03555785ea1019a388b0e0fe7dacac70da8821 /ui | |
parent | 99b36bc2d7e6cb99505e7c48109aad03bab109ae (diff) | |
download | chromium_src-8368f194019805e5cca637e2b94d78ac9724d29d.zip chromium_src-8368f194019805e5cca637e2b94d78ac9724d29d.tar.gz chromium_src-8368f194019805e5cca637e2b94d78ac9724d29d.tar.bz2 |
In default X11 error handler, do not post task to message loop if there is no message loop.
There might not be a message loop if the X11 error happens early in initialization. This is the case for GLX initialization in the GPU process.
If there is no message loop, a simple error is logged containing the serial, error code, request code and minor code.
The purpose of posting a task to the message loop is to output a more descriptive error, involving calling various X11 functions such as XGetErrorText, which cannot be called in the error handler itself becasue of reentrancy issues.
BUG=109180
Review URL: http://codereview.chromium.org/9114014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/x/x11_util.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 8593a2b..dd47c10 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc @@ -72,9 +72,18 @@ CachedPictFormats* get_cached_pict_formats() { const size_t kMaxCacheSize = 5; int DefaultX11ErrorHandler(Display* d, XErrorEvent* e) { - MessageLoop::current()->PostTask( - FROM_HERE, - base::Bind(&LogErrorEventDescription, d, *e)); + if (MessageLoop::current()) { + MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&LogErrorEventDescription, d, *e)); + } else { + LOG(ERROR) + << "X Error detected: " + << "serial " << e->serial << ", " + << "error_code " << static_cast<int>(e->error_code) << ", " + << "request_code " << static_cast<int>(e->request_code) << ", " + << "minor_code " << static_cast<int>(e->minor_code); + } return 0; } |