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

Side by Side Diff: ui/base/x/x11_util.cc

Issue 9333005: Fix some memory leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/view_unittest.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) 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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 key_event.y = 0; 996 key_event.y = 0;
997 key_event.x_root = 0; 997 key_event.x_root = 0;
998 key_event.y_root = 0; 998 key_event.y_root = 0;
999 key_event.state = XKeyEventState(flags); 999 key_event.state = XKeyEventState(flags);
1000 key_event.keycode = XKeyEventKeyCode(key_code, flags, display); 1000 key_event.keycode = XKeyEventKeyCode(key_code, flags, display);
1001 key_event.same_screen = 1; 1001 key_event.same_screen = 1;
1002 event->type = key_event.type; 1002 event->type = key_event.type;
1003 event->xkey = key_event; 1003 event->xkey = key_event;
1004 } 1004 }
1005 1005
1006 XScopedString::~XScopedString() {
1007 XFree(string_);
1008 }
1009
1006 // ---------------------------------------------------------------------------- 1010 // ----------------------------------------------------------------------------
1007 // These functions are declared in x11_util_internal.h because they require 1011 // These functions are declared in x11_util_internal.h because they require
1008 // XLib.h to be included, and it conflicts with many other headers. 1012 // XLib.h to be included, and it conflicts with many other headers.
1009 XRenderPictFormat* GetRenderARGB32Format(Display* dpy) { 1013 XRenderPictFormat* GetRenderARGB32Format(Display* dpy) {
1010 static XRenderPictFormat* pictformat = NULL; 1014 static XRenderPictFormat* pictformat = NULL;
1011 if (pictformat) 1015 if (pictformat)
1012 return pictformat; 1016 return pictformat;
1013 1017
1014 // First look for a 32-bit format which ignores the alpha value 1018 // First look for a 32-bit format which ignores the alpha value
1015 XRenderPictFormat templ; 1019 XRenderPictFormat templ;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 << "request_code " << static_cast<int>(error_event.request_code) << ", " 1130 << "request_code " << static_cast<int>(error_event.request_code) << ", "
1127 << "minor_code " << static_cast<int>(error_event.minor_code) 1131 << "minor_code " << static_cast<int>(error_event.minor_code)
1128 << " (" << request_str << ")"; 1132 << " (" << request_str << ")";
1129 } 1133 }
1130 1134
1131 // ---------------------------------------------------------------------------- 1135 // ----------------------------------------------------------------------------
1132 // End of x11_util_internal.h 1136 // End of x11_util_internal.h
1133 1137
1134 1138
1135 } // namespace ui 1139 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698