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

Unified Diff: chrome/browser/icon_loader_win.cc

Issue 2709683002: Remove unneeded IconLoader::image_ (Closed)
Patch Set: fix Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/icon_loader_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_win.cc
diff --git a/chrome/browser/icon_loader_win.cc b/chrome/browser/icon_loader_win.cc
index 279c819cc4921be1305b31d9d2ef7a55d8c71c81..035c759e42bf6a19c5ddd051d94bdad3c9a87ed9 100644
--- a/chrome/browser/icon_loader_win.cc
+++ b/chrome/browser/icon_loader_win.cc
@@ -8,6 +8,7 @@
#include <shellapi.h>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -49,7 +50,7 @@ void IconLoader::ReadIcon() {
NOTREACHED();
}
- image_.reset();
+ std::unique_ptr<gfx::Image> image;
SHFILEINFO file_info = { 0 };
if (SHGetFileInfo(group_.c_str(), FILE_ATTRIBUTE_NORMAL, &file_info,
@@ -61,12 +62,12 @@ void IconLoader::ReadIcon() {
gfx::ImageSkia image_skia(gfx::ImageSkiaRep(*bitmap,
display::win::GetDPIScale()));
image_skia.MakeThreadSafe();
- image_.reset(new gfx::Image(image_skia));
+ image = base::MakeUnique<gfx::Image>(image_skia);
DestroyIcon(file_info.hIcon);
}
}
target_task_runner_->PostTask(
- FROM_HERE, base::Bind(callback_, base::Passed(&image_), group_));
+ FROM_HERE, base::Bind(callback_, base::Passed(&image), group_));
delete this;
}
« no previous file with comments | « chrome/browser/icon_loader_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698