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

Side by Side Diff: ash/desktop_background/desktop_background_view.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_view.h" 5 #include "ash/desktop_background/desktop_background_view.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 private: 44 private:
45 // Overridden from ui::ImplicitAnimationObserver: 45 // Overridden from ui::ImplicitAnimationObserver:
46 virtual void OnImplicitAnimationsCompleted() OVERRIDE { 46 virtual void OnImplicitAnimationsCompleted() OVERRIDE {
47 ash::Shell* shell = ash::Shell::GetInstance(); 47 ash::Shell* shell = ash::Shell::GetInstance();
48 shell->user_wallpaper_delegate()->OnWallpaperAnimationFinished(); 48 shell->user_wallpaper_delegate()->OnWallpaperAnimationFinished();
49 // Only removes old component when wallpaper animation finished. If we 49 // Only removes old component when wallpaper animation finished. If we
50 // remove the old one too early, there will be a white flash during 50 // remove the old one too early, there will be a white flash during
51 // animation. 51 // animation.
52 if (root_window_->GetProperty(kComponentWrapper)) { 52 if (root_window_->GetProperty(kComponentWrapper)) {
53 internal::DesktopBackgroundWidgetController* component = 53 internal::DesktopBackgroundWidgetController* component =
54 root_window_->GetProperty(kComponentWrapper)->component(); 54 root_window_->GetProperty(kComponentWrapper)->GetComponent(true);
55 LOG(ERROR) << "===taken ownership===";
sky 2012/08/15 20:45:42 remove this.
bshe 2012/08/15 20:49:39 Aha. Sorry, I missed it.
55 root_window_->SetProperty(kWindowDesktopComponent, component); 56 root_window_->SetProperty(kWindowDesktopComponent, component);
56 } 57 }
57 58
58 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 59 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
59 } 60 }
60 61
61 aura::RootWindow* root_window_; 62 aura::RootWindow* root_window_;
62 int container_id_; 63 int container_id_;
63 views::Widget* desktop_widget_; 64 views::Widget* desktop_widget_;
64 65
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, 181 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window,
181 container_id, 182 container_id,
182 desktop_widget)); 183 desktop_widget));
183 desktop_widget->Show(); 184 desktop_widget->Show();
184 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); 185 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView");
185 return desktop_widget; 186 return desktop_widget;
186 } 187 }
187 188
188 } // namespace internal 189 } // namespace internal
189 } // namespace ash 190 } // namespace ash
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller.cc ('k') | ash/desktop_background/desktop_background_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698