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

Side by Side Diff: base/x11/x11_error_tracker.cc

Issue 24160005: Move ui/base/x/x11_error_tracker to base/x11. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 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
« no previous file with comments | « base/x11/x11_error_tracker.h ('k') | base/x11/x11_error_tracker_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/base/x/x11_util.h" 7 #include "base/message_loop/message_pump_x11.h"
8 8
9 namespace { 9 namespace {
10 10
11 unsigned char g_x11_error_code = 0; 11 unsigned char g_x11_error_code = 0;
12 12
13 int X11ErrorHandler(XDisplay* display, XErrorEvent* error) { 13 int X11ErrorHandler(Display* display, XErrorEvent* error) {
14 g_x11_error_code = error->error_code; 14 g_x11_error_code = error->error_code;
15 return 0; 15 return 0;
16 } 16 }
17 17
18 } 18 }
19 19
20 namespace ui { 20 namespace base {
21 21
22 X11ErrorTracker::X11ErrorTracker() { 22 X11ErrorTracker::X11ErrorTracker() {
23 old_handler_ = XSetErrorHandler(X11ErrorHandler); 23 old_handler_ = XSetErrorHandler(X11ErrorHandler);
24 } 24 }
25 25
26 X11ErrorTracker::~X11ErrorTracker() { 26 X11ErrorTracker::~X11ErrorTracker() {
27 XSetErrorHandler(old_handler_); 27 XSetErrorHandler(old_handler_);
28 } 28 }
29 29
30 bool X11ErrorTracker::FoundNewError() { 30 bool X11ErrorTracker::FoundNewError() {
31 XSync(gfx::GetXDisplay(), False); 31 XSync(MessagePumpForUI::GetDefaultXDisplay(), False);
32 unsigned char error = g_x11_error_code; 32 unsigned char error = g_x11_error_code;
33 g_x11_error_code = 0; 33 g_x11_error_code = 0;
34 return error != 0; 34 return error != 0;
35 } 35 }
36 36
37 } // namespace ui 37 } // namespace ui
OLDNEW
« no previous file with comments | « base/x11/x11_error_tracker.h ('k') | base/x11/x11_error_tracker_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698