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

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: 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 //
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 UI_EXPORT void SetX11ErrorHandlers(XErrorHandler error_handler, 43 UI_EXPORT void SetX11ErrorHandlers(XErrorHandler error_handler,
44 XIOErrorHandler io_error_handler); 44 XIOErrorHandler io_error_handler);
45 45
46 // NOTE: This function should not be called directly from the 46 // NOTE: This function should not be called directly from the
47 // X11 Error handler because it queries the server to decode the 47 // X11 Error handler because it queries the server to decode the
48 // error message, which may trigger other errors. A suitable workaround 48 // error message, which may trigger other errors. A suitable workaround
49 // is to post a task in the error handler to call this function. 49 // is to post a task in the error handler to call this function.
50 UI_EXPORT void LogErrorEventDescription(Display* dpy, 50 UI_EXPORT void LogErrorEventDescription(Display* dpy,
51 const XErrorEvent& error_event); 51 const XErrorEvent& error_event);
52 52
53 class ScopedX11ErrorHandlerOverride {
54 public:
55 ScopedX11ErrorHandlerOverride(XErrorHandler error_handler,
56 XIOErrorHandler io_error_handler);
57 ~ScopedX11ErrorHandlerOverride();
58
59 private:
60 XErrorHandler old_error_handler_;
61 XIOErrorHandler old_io_error_handler_;
62
63 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedX11ErrorHandlerOverride);
64 };
65
53 } // namespace ui 66 } // namespace ui
54 67
55 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ 68 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698