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

Unified Diff: chrome/browser/icon_loader.cc

Issue 2440273002: Clean up the IconLoader. (Closed)
Patch Set: nits Created 4 years 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_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_loader.cc
diff --git a/chrome/browser/icon_loader.cc b/chrome/browser/icon_loader.cc
index 979ee5772c15fc40f2ee2e653a7c54197b5b0aa4..262bc54a12e8aea0c863edebbf6809fb332df9e4 100644
--- a/chrome/browser/icon_loader.cc
+++ b/chrome/browser/icon_loader.cc
@@ -13,8 +13,7 @@ using content::BrowserThread;
IconLoader::IconLoader(const base::FilePath& file_path,
IconSize size,
Delegate* delegate)
- : target_task_runner_(NULL),
- file_path_(file_path),
+ : file_path_(file_path),
icon_size_(size),
delegate_(delegate) {}
@@ -30,20 +29,14 @@ void IconLoader::Start() {
}
void IconLoader::ReadGroup() {
- group_ = ReadGroupIDFromFilepath(file_path_);
+ group_ = GroupForFilepath(file_path_);
}
void IconLoader::OnReadGroup() {
- if (IsIconMutableFromFilepath(file_path_) ||
- !delegate_->OnGroupLoaded(this, group_)) {
- BrowserThread::PostTask(ReadIconThreadID(), FROM_HERE,
- base::Bind(&IconLoader::ReadIcon, this));
- }
+ BrowserThread::PostTask(ReadIconThreadID(), FROM_HERE,
+ base::Bind(&IconLoader::ReadIcon, this));
}
void IconLoader::NotifyDelegate() {
- // If the delegate takes ownership of the Image, release it from the scoped
- // pointer.
- if (delegate_->OnImageLoaded(this, image_.get(), group_))
- ignore_result(image_.release()); // Can't ignore return value.
+ delegate_->OnImageLoaded(this, std::move(image_), group_);
}
« no previous file with comments | « chrome/browser/icon_loader.h ('k') | chrome/browser/icon_loader_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698