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

Side by Side Diff: ui/base/x/x11_util_internal.h

Issue 7889040: Change X11 error handler override to allow easy X11 error checking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing Xwindows.h Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_ 5 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_
6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_ 6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_
7 #pragma once 7 #pragma once
8 8
9 // This file declares utility functions for X11 (Linux only). 9 // This file declares utility functions for X11 (Linux only).
10 // 10 //
11 // These functions require the inclusion of the Xlib headers. Since the Xlib 11 // These functions require the inclusion of the Xlib headers. Since the Xlib
12 // headers pollute so much of the namespace, this should only be included 12 // headers pollute so much of the namespace, this should only be included
13 // when needed. 13 // when needed.
14 14
15 extern "C" { 15 extern "C" {
16 #include <X11/Xatom.h> 16 #include <X11/Xatom.h>
17 #include <X11/Xdefs.h>
17 #include <X11/Xlib.h> 18 #include <X11/Xlib.h>
18 #include <X11/extensions/XShm.h> 19 #include <X11/extensions/XShm.h>
19 #include <X11/extensions/Xrender.h> 20 #include <X11/extensions/Xrender.h>
20 } 21 }
21 22
22 #include "ui/base/ui_export.h" 23 #include "ui/base/ui_export.h"
23 24
24 namespace ui { 25 namespace ui {
25 26
26 // -------------------------------------------------------------------------- 27 // --------------------------------------------------------------------------
(...skipping 16 matching lines...) Expand all
43 UI_EXPORT void SetX11ErrorHandlers(XErrorHandler error_handler, 44 UI_EXPORT void SetX11ErrorHandlers(XErrorHandler error_handler,
44 XIOErrorHandler io_error_handler); 45 XIOErrorHandler io_error_handler);
45 46
46 // NOTE: This function should not be called directly from the 47 // NOTE: This function should not be called directly from the
47 // X11 Error handler because it queries the server to decode the 48 // X11 Error handler because it queries the server to decode the
48 // error message, which may trigger other errors. A suitable workaround 49 // error message, which may trigger other errors. A suitable workaround
49 // is to post a task in the error handler to call this function. 50 // is to post a task in the error handler to call this function.
50 UI_EXPORT void LogErrorEventDescription(Display* dpy, 51 UI_EXPORT void LogErrorEventDescription(Display* dpy,
51 const XErrorEvent& error_event); 52 const XErrorEvent& error_event);
52 53
54 // Returns the last X11 error encountered and clears it. Calls XSync to ensure
55 // all requests have been received and processed by the X server.
Ami GONE FROM CHROMIUM 2011/09/14 23:23:11 Document semantics of NULL return.
Ami GONE FROM CHROMIUM 2011/09/14 23:23:11 If you really returned a pointer here you'd want y
56 UI_EXPORT XErrorEvent* GetLastX11Error(Display* display);
Ami GONE FROM CHROMIUM 2011/09/14 23:23:11 s/Get/GetAndClear/
Ami GONE FROM CHROMIUM 2011/09/14 23:23:11 I wonder about the threading semantics here. Do y
57
53 } // namespace ui 58 } // namespace ui
54 59
55 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ 60 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_
OLDNEW
« ui/base/x/x11_util.cc ('K') | « ui/base/x/x11_util.cc ('k') | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698