Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1600)

Unified Diff: app/x11_util.cc

Issue 2716007: Linux: Catch X errors and force a crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/x11_util.h ('k') | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/x11_util.cc
===================================================================
--- app/x11_util.cc (revision 49446)
+++ app/x11_util.cc (working copy)
@@ -52,8 +52,26 @@
// Maximum number of CachedPictFormats we keep around.
const size_t kMaxCacheSize = 5;
+int X11ErrorHandler(Display* d, XErrorEvent* e) {
+ LOG(FATAL) << "X Error detected: serial " << e->serial
+ << " error_code " << static_cast<unsigned int>(e->error_code)
+ << " request_code " << static_cast<unsigned int>(e->request_code)
+ << " minor_code " << static_cast<unsigned int>(e->minor_code);
+ return 0;
+}
+
+int X11IOErrorHandler(Display* d) {
+ LOG(FATAL) << "X IO Error detected";
+ return 0;
+}
+
} // namespace
+void SetX11ErrorHandlers() {
+ XSetErrorHandler(X11ErrorHandler);
+ XSetIOErrorHandler(X11IOErrorHandler);
+}
+
bool XDisplayExists() {
return (gdk_display_get_default() != NULL);
}
« no previous file with comments | « app/x11_util.h ('k') | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698