1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_GFX_X_X11_ERROR_TRACKER_H_
6 #define UI_GFX_X_X11_ERROR_TRACKER_H_
10 #include "base/basictypes.h"
11 #include "ui/gfx/gfx_export.h"
15 // X11ErrorTracker catches X11 errors in a non-fatal way. It does so by
16 // temporarily changing the X11 error handler. The old error handler is
17 // restored when the tracker is destroyed.
18 class GFX_EXPORT X11ErrorTracker
{
23 // Returns whether an X11 error happened since this function was last called
24 // (or since the creation of the tracker). This is potentially expensive,
25 // since this causes a sync with the X server.
29 XErrorHandler old_handler_
;
31 DISALLOW_COPY_AND_ASSIGN(X11ErrorTracker
);
36 #endif // UI_GFX_X_X11_ERROR_TRACKER_H_