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

Unified Diff: chrome/browser/icon_loader_auralinux.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.h ('k') | chrome/browser/icon_loader_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader_auralinux.cc
diff --git a/chrome/browser/icon_loader_auralinux.cc b/chrome/browser/icon_loader_auralinux.cc
index 449d05771d76648cce40da5091ee722085971f86..a1c098b9ed32fb43012b63389a1b44c485138625 100644
--- a/chrome/browser/icon_loader_auralinux.cc
+++ b/chrome/browser/icon_loader_auralinux.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/icon_loader.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/nix/mime_util_xdg.h"
#include "ui/views/linux_ui/linux_ui.h"
@@ -38,14 +39,16 @@ void IconLoader::ReadIcon() {
NOTREACHED();
}
+ std::unique_ptr<gfx::Image> image;
views::LinuxUI* ui = views::LinuxUI::instance();
if (ui) {
- gfx::Image image = ui->GetIconForContentType(group_, size_pixels);
- if (!image.IsEmpty())
- image_.reset(new gfx::Image(image));
+ image = base::MakeUnique<gfx::Image>(
+ ui->GetIconForContentType(group_, size_pixels));
+ if (image->IsEmpty())
+ image = nullptr;
}
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.h ('k') | chrome/browser/icon_loader_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698