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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc

Issue 989993002: x11: Use scoped_ptr<> for X11 objects where it makes sense. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
index 8fc6b74ad219fd7fbb08b2b43b7ec938e09b9f9e..38aa0c872d8af06486134e21e859325ea953b1a9 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
@@ -156,21 +156,14 @@ scoped_ptr<Widget> CreateWidget(WidgetDelegate* delegate) {
std::vector<gfx::Rect> GetShapeRects(XID xid) {
int dummy;
int shape_rects_size;
- XRectangle* shape_rects = XShapeGetRectangles(gfx::GetXDisplay(),
- xid,
- ShapeBounding,
- &shape_rects_size,
- &dummy);
+ gfx::XScopedPtr<XRectangle[]> shape_rects(XShapeGetRectangles(
+ gfx::GetXDisplay(), xid, ShapeBounding, &shape_rects_size, &dummy));
std::vector<gfx::Rect> shape_vector;
for (int i = 0; i < shape_rects_size; ++i) {
- shape_vector.push_back(gfx::Rect(
- shape_rects[i].x,
- shape_rects[i].y,
- shape_rects[i].width,
- shape_rects[i].height));
+ const XRectangle& rect = shape_rects[i];
+ shape_vector.push_back(gfx::Rect(rect.x, rect.y, rect.width, rect.height));
}
- XFree(shape_rects);
return shape_vector;
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698