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

Side by Side Diff: ash/desktop_background/desktop_background_widget_controller.cc

Issue 10854153: Fix memory leak on Chromium OS Heapcheck and Chromium OS (valgrind) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use scoped ptr to manage ownership Created 8 years, 4 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
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 #include "ash/desktop_background/desktop_background_widget_controller.h" 5 #include "ash/desktop_background/desktop_background_widget_controller.h"
6 6
7 #include "ui/aura/root_window.h" 7 #include "ui/aura/root_window.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::DesktopBackgroundWidgetController*); 10 DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::DesktopBackgroundWidgetController*);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 views::Widget::ReparentNativeView(widget_->GetNativeView(), 48 views::Widget::ReparentNativeView(widget_->GetNativeView(),
49 root_window->GetChildById(dest_container)); 49 root_window->GetChildById(dest_container));
50 } else if (layer_.get()) { 50 } else if (layer_.get()) {
51 ui::Layer* layer = layer_.get(); 51 ui::Layer* layer = layer_.get();
52 root_window->GetChildById(src_container)->layer()->Remove(layer); 52 root_window->GetChildById(src_container)->layer()->Remove(layer);
53 root_window->GetChildById(dest_container)->layer()->Add(layer); 53 root_window->GetChildById(dest_container)->layer()->Add(layer);
54 } 54 }
55 } 55 }
56 56
57 ComponentWrapper::ComponentWrapper( 57 ComponentWrapper::ComponentWrapper(
58 DesktopBackgroundWidgetController* component) : component_(component) { 58 DesktopBackgroundWidgetController* component) {
59 component_.reset(component);
60 }
61
62 DesktopBackgroundWidgetController* ComponentWrapper::GetComponent(
63 bool pass_ownership) {
64 if (pass_ownership)
65 return component_.release();
66 return component_.get();
59 } 67 }
60 68
61 } // namespace internal 69 } // namespace internal
62 } // namespace ash 70 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698