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

Unified Diff: components/wallpaper/wallpaper_manager_base.cc

Issue 1794323003: Make user_manager::UserImage non-copyable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: components/wallpaper/wallpaper_manager_base.cc
diff --git a/components/wallpaper/wallpaper_manager_base.cc b/components/wallpaper/wallpaper_manager_base.cc
index eabe252ce15513904e4be916b8a2d43443692cf6..d618ae68284e77b77ba226c43a8a8a957b477310 100644
--- a/components/wallpaper/wallpaper_manager_base.cc
+++ b/components/wallpaper/wallpaper_manager_base.cc
@@ -910,17 +910,17 @@ base::TimeDelta WallpaperManagerBase::GetWallpaperLoadDelay() const {
void WallpaperManagerBase::OnCustomizedDefaultWallpaperDecoded(
const GURL& wallpaper_url,
scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
- const user_manager::UserImage& wallpaper) {
+ scoped_ptr< user_manager::UserImage> wallpaper) {
hashimoto 2016/03/15 08:39:27 nit: "< " -> "<"
satorux1 2016/03/16 02:01:30 Done.
DCHECK(thread_checker_.CalledOnValidThread());
// If decoded wallpaper is empty, we have probably failed to decode the file.
- if (wallpaper.image().isNull()) {
+ if (wallpaper->image().isNull()) {
LOG(WARNING) << "Failed to decode customized wallpaper.";
return;
}
- wallpaper.image().EnsureRepsForSupportedScales();
- scoped_ptr<gfx::ImageSkia> deep_copy(wallpaper.image().DeepCopy());
+ wallpaper->image().EnsureRepsForSupportedScales();
+ scoped_ptr<gfx::ImageSkia> deep_copy(wallpaper->image().DeepCopy());
hashimoto 2016/03/15 08:39:27 Do we still need to deep copy the image here? Can'
satorux1 2016/03/16 02:01:30 Good point. Wanted to test but this code path is h
scoped_ptr<bool> success(new bool(false));
scoped_ptr<gfx::ImageSkia> small_wallpaper_image(new gfx::ImageSkia);
@@ -929,7 +929,7 @@ void WallpaperManagerBase::OnCustomizedDefaultWallpaperDecoded(
// TODO(bshe): This may break if Bytes becomes RefCountedMemory.
base::Closure resize_closure = base::Bind(
&WallpaperManagerBase::ResizeCustomizedDefaultWallpaper,
- base::Passed(&deep_copy), wallpaper.image_bytes(),
+ base::Passed(&deep_copy), wallpaper->image_bytes(),
hashimoto 2016/03/15 08:39:27 This line still copies image bytes.
satorux1 2016/03/16 02:01:30 Added a TODO comment.
base::Unretained(rescaled_files.get()), base::Unretained(success.get()),
base::Unretained(small_wallpaper_image.get()),
base::Unretained(large_wallpaper_image.get()));

Powered by Google App Engine
This is Rietveld 408576698