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

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

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/touch/touch_factory.cc ('k') | ui/base/x/x11_util.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 #ifndef UI_BASE_X_X11_UTIL_H_ 5 #ifndef UI_BASE_X_X11_UTIL_H_
6 #define UI_BASE_X_X11_UTIL_H_ 6 #define UI_BASE_X_X11_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 // This file declares utility functions for X11 (Linux only). 9 // This file declares utility functions for X11 (Linux only).
10 // 10 //
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // received. 248 // received.
249 UI_EXPORT void UpdateButtonMap(); 249 UI_EXPORT void UpdateButtonMap();
250 250
251 // Initializes a XEvent that holds XKeyEvent for testing. Note that ui::EF_ 251 // Initializes a XEvent that holds XKeyEvent for testing. Note that ui::EF_
252 // flags should be passed as |flags|, not the native ones in <X11/X.h>. 252 // flags should be passed as |flags|, not the native ones in <X11/X.h>.
253 UI_EXPORT void InitXKeyEventForTesting(EventType type, 253 UI_EXPORT void InitXKeyEventForTesting(EventType type,
254 KeyboardCode key_code, 254 KeyboardCode key_code,
255 int flags, 255 int flags,
256 XEvent* event); 256 XEvent* event);
257 257
258 // Keeps track of a string returned by an X function (e.g. XGetAtomName) and
259 // makes sure it's XFree'd.
260 class UI_EXPORT XScopedString {
261 public:
262 explicit XScopedString(char *str) : string_(str) { }
sky 2012/02/07 20:55:01 'char *str' -> 'char* str' (same on line 268)
sadrul 2012/02/07 21:30:08 Whoops. Sorry! Fixed.
263 ~XScopedString();
264
265 const char *string() const { return string_; }
266
267 private:
268 char *string_;
269
270 DISALLOW_COPY_AND_ASSIGN(XScopedString);
271 };
272
258 } // namespace ui 273 } // namespace ui
259 274
260 #endif // UI_BASE_X_X11_UTIL_H_ 275 #endif // UI_BASE_X_X11_UTIL_H_
OLDNEW
« no previous file with comments | « ui/base/touch/touch_factory.cc ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698