crypto/nss_util: Get TPM slot id, do lookup by id instead of by name.
[chromium-blink-merge.git] / base / x11 / x11_error_tracker.h
blob5542f52a0562470e75902cab24ca9e7eda610fbf
1 // Copyright 2013 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 BASE_X11_X11_ERROR_TRACKER_H_
6 #define BASE_X11_X11_ERROR_TRACKER_H_
8 #include <X11/Xlib.h>
10 #include "base/base_export.h"
11 #include "base/basictypes.h"
13 namespace base {
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 BASE_EXPORT X11ErrorTracker {
19 public:
20 X11ErrorTracker();
21 ~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.
26 bool FoundNewError();
28 private:
29 #if !defined(TOOLKIT_GTK)
30 XErrorHandler old_handler_;
31 #endif
33 DISALLOW_COPY_AND_ASSIGN(X11ErrorTracker);
36 } // namespace base
38 #endif // BASE_X11_X11_ERROR_TRACKER_H_