OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "ui/base/x/x11_error_tracker.h" | 5 #include "base/x11/x11_error_tracker.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 namespace ui { | 11 namespace base { |
12 | 12 |
13 X11ErrorTracker::X11ErrorTracker() { | 13 X11ErrorTracker::X11ErrorTracker() { |
14 gdk_error_trap_push(); | 14 gdk_error_trap_push(); |
15 } | 15 } |
16 | 16 |
17 X11ErrorTracker::~X11ErrorTracker() { | 17 X11ErrorTracker::~X11ErrorTracker() { |
18 gdk_error_trap_pop(); | 18 gdk_error_trap_pop(); |
19 } | 19 } |
20 | 20 |
21 bool X11ErrorTracker::FoundNewError() { | 21 bool X11ErrorTracker::FoundNewError() { |
22 gdk_flush(); | 22 gdk_flush(); |
23 bool found_error = gdk_error_trap_pop() != 0; | 23 bool found_error = gdk_error_trap_pop() != 0; |
24 | 24 |
25 gdk_error_trap_push(); | 25 gdk_error_trap_push(); |
26 return found_error; | 26 return found_error; |
27 } | 27 } |
28 | 28 |
29 } // namespace ui | 29 } // namespace base |
OLD | NEW |