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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 dpy, "XRequest", num.c_str(), "Unknown", request_str, | 1786 dpy, "XRequest", num.c_str(), "Unknown", request_str, |
1787 sizeof(request_str)); | 1787 sizeof(request_str)); |
1788 } else { | 1788 } else { |
1789 int num_ext; | 1789 int num_ext; |
1790 char** ext_list = XListExtensions(dpy, &num_ext); | 1790 char** ext_list = XListExtensions(dpy, &num_ext); |
1791 | 1791 |
1792 for (int i = 0; i < num_ext; i++) { | 1792 for (int i = 0; i < num_ext; i++) { |
1793 int ext_code, first_event, first_error; | 1793 int ext_code, first_event, first_error; |
1794 XQueryExtension(dpy, ext_list[i], &ext_code, &first_event, &first_error); | 1794 XQueryExtension(dpy, ext_list[i], &ext_code, &first_event, &first_error); |
1795 if (error_event.request_code == ext_code) { | 1795 if (error_event.request_code == ext_code) { |
1796 std::string msg = StringPrintf( | 1796 std::string msg = base::StringPrintf( |
1797 "%s.%d", ext_list[i], error_event.minor_code); | 1797 "%s.%d", ext_list[i], error_event.minor_code); |
1798 XGetErrorDatabaseText( | 1798 XGetErrorDatabaseText( |
1799 dpy, "XRequest", msg.c_str(), "Unknown", request_str, | 1799 dpy, "XRequest", msg.c_str(), "Unknown", request_str, |
1800 sizeof(request_str)); | 1800 sizeof(request_str)); |
1801 break; | 1801 break; |
1802 } | 1802 } |
1803 } | 1803 } |
1804 XFreeExtensionList(ext_list); | 1804 XFreeExtensionList(ext_list); |
1805 } | 1805 } |
1806 | 1806 |
1807 LOG(ERROR) | 1807 LOG(ERROR) |
1808 << "X error received: " | 1808 << "X error received: " |
1809 << "serial " << error_event.serial << ", " | 1809 << "serial " << error_event.serial << ", " |
1810 << "error_code " << static_cast<int>(error_event.error_code) | 1810 << "error_code " << static_cast<int>(error_event.error_code) |
1811 << " (" << error_str << "), " | 1811 << " (" << error_str << "), " |
1812 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1812 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1813 << "minor_code " << static_cast<int>(error_event.minor_code) | 1813 << "minor_code " << static_cast<int>(error_event.minor_code) |
1814 << " (" << request_str << ")"; | 1814 << " (" << request_str << ")"; |
1815 } | 1815 } |
1816 | 1816 |
1817 // ---------------------------------------------------------------------------- | 1817 // ---------------------------------------------------------------------------- |
1818 // End of x11_util_internal.h | 1818 // End of x11_util_internal.h |
1819 | 1819 |
1820 | 1820 |
1821 } // namespace ui | 1821 } // namespace ui |
OLD | NEW |