Chromium Code Reviews| Index: chrome/browser/icon_loader.cc |
| diff --git a/chrome/browser/icon_loader.cc b/chrome/browser/icon_loader.cc |
| index 979ee5772c15fc40f2ee2e653a7c54197b5b0aa4..2ea935f30972e4bc5d775ed69a467d3f0714aae8 100644 |
| --- a/chrome/browser/icon_loader.cc |
| +++ b/chrome/browser/icon_loader.cc |
| @@ -13,7 +13,7 @@ using content::BrowserThread; |
| IconLoader::IconLoader(const base::FilePath& file_path, |
| IconSize size, |
| Delegate* delegate) |
| - : target_task_runner_(NULL), |
| + : target_task_runner_(nullptr), |
|
sky
2016/12/15 22:36:05
optional: remove the initializer entirely (null is
Avi (use Gerrit)
2016/12/15 23:01:09
Done.
|
| file_path_(file_path), |
| icon_size_(size), |
| delegate_(delegate) {} |
| @@ -30,20 +30,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_); |
| } |