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

Unified Diff: chrome/browser/icon_loader_mac.mm

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_chromeos.cc ('k') | chrome/browser/icon_loader_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_mac.mm
diff --git a/chrome/browser/icon_loader_mac.mm b/chrome/browser/icon_loader_mac.mm
index dd94e9fe7eab1e17b1ead5efb7766cbd0466802e..392f2b22b2535953baf0b4b6b1f66e169aec7f91 100644
--- a/chrome/browser/icon_loader_mac.mm
+++ b/chrome/browser/icon_loader_mac.mm
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/thread.h"
@@ -30,9 +31,11 @@ void IconLoader::ReadIcon() {
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];
NSImage* icon = [workspace iconForFileType:group];
+ std::unique_ptr<gfx::Image> image;
+
if (icon_size_ == ALL) {
// The NSImage already has all sizes.
- image_.reset(new gfx::Image([icon retain]));
+ image = base::MakeUnique<gfx::Image>([icon retain]);
} else {
NSSize size = NSZeroSize;
switch (icon_size_) {
@@ -48,11 +51,11 @@ void IconLoader::ReadIcon() {
gfx::ImageSkia image_skia(gfx::ImageSkiaFromResizedNSImage(icon, size));
if (!image_skia.isNull()) {
image_skia.MakeThreadSafe();
- image_.reset(new gfx::Image(image_skia));
+ image = base::MakeUnique<gfx::Image>(image_skia);
}
}
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_chromeos.cc ('k') | chrome/browser/icon_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698