OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 static CachedPictFormats* formats = NULL; | 91 static CachedPictFormats* formats = NULL; |
92 if (!formats) | 92 if (!formats) |
93 formats = new CachedPictFormats(); | 93 formats = new CachedPictFormats(); |
94 return formats; | 94 return formats; |
95 } | 95 } |
96 | 96 |
97 // Maximum number of CachedPictFormats we keep around. | 97 // Maximum number of CachedPictFormats we keep around. |
98 const size_t kMaxCacheSize = 5; | 98 const size_t kMaxCacheSize = 5; |
99 | 99 |
100 int DefaultX11ErrorHandler(Display* d, XErrorEvent* e) { | 100 int DefaultX11ErrorHandler(Display* d, XErrorEvent* e) { |
101 if (MessageLoop::current()) { | 101 if (base::MessageLoop::current()) { |
102 MessageLoop::current()->PostTask( | 102 base::MessageLoop::current()->PostTask( |
103 FROM_HERE, | 103 FROM_HERE, base::Bind(&LogErrorEventDescription, d, *e)); |
104 base::Bind(&LogErrorEventDescription, d, *e)); | |
105 } else { | 104 } else { |
106 LOG(ERROR) | 105 LOG(ERROR) |
107 << "X error received: " | 106 << "X error received: " |
108 << "serial " << e->serial << ", " | 107 << "serial " << e->serial << ", " |
109 << "error_code " << static_cast<int>(e->error_code) << ", " | 108 << "error_code " << static_cast<int>(e->error_code) << ", " |
110 << "request_code " << static_cast<int>(e->request_code) << ", " | 109 << "request_code " << static_cast<int>(e->request_code) << ", " |
111 << "minor_code " << static_cast<int>(e->minor_code); | 110 << "minor_code " << static_cast<int>(e->minor_code); |
112 } | 111 } |
113 return 0; | 112 return 0; |
114 } | 113 } |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1809 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1811 << "minor_code " << static_cast<int>(error_event.minor_code) | 1810 << "minor_code " << static_cast<int>(error_event.minor_code) |
1812 << " (" << request_str << ")"; | 1811 << " (" << request_str << ")"; |
1813 } | 1812 } |
1814 | 1813 |
1815 // ---------------------------------------------------------------------------- | 1814 // ---------------------------------------------------------------------------- |
1816 // End of x11_util_internal.h | 1815 // End of x11_util_internal.h |
1817 | 1816 |
1818 | 1817 |
1819 } // namespace ui | 1818 } // namespace ui |
OLD | NEW |