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

Side by Side Diff: chrome/browser/icon_loader.cc

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/icon_loader_auralinux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/icon_loader.h" 5 #include "chrome/browser/icon_loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 using content::BrowserThread; 11 using content::BrowserThread;
12 12
13 // static 13 // static
14 IconLoader* IconLoader::Create(const base::FilePath& file_path, 14 IconLoader* IconLoader::Create(const base::FilePath& file_path,
15 IconSize size, 15 IconSize size,
16 IconLoadedCallback callback) { 16 IconLoadedCallback callback) {
17 return new IconLoader(file_path, size, callback); 17 return new IconLoader(file_path, size, callback);
18 } 18 }
19 19
20 void IconLoader::Start() { 20 void IconLoader::Start() {
21 target_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 21 target_task_runner_ = base::ThreadTaskRunnerHandle::Get();
22 22
23 BrowserThread::PostTaskAndReply( 23 BrowserThread::PostTaskAndReply(
24 BrowserThread::FILE, FROM_HERE, 24 BrowserThread::FILE, FROM_HERE,
25 base::Bind(&IconLoader::ReadGroup, base::Unretained(this)), 25 base::BindOnce(&IconLoader::ReadGroup, base::Unretained(this)),
26 base::Bind(&IconLoader::OnReadGroup, base::Unretained(this))); 26 base::BindOnce(&IconLoader::OnReadGroup, base::Unretained(this)));
27 } 27 }
28 28
29 IconLoader::IconLoader(const base::FilePath& file_path, 29 IconLoader::IconLoader(const base::FilePath& file_path,
30 IconSize size, 30 IconSize size,
31 IconLoadedCallback callback) 31 IconLoadedCallback callback)
32 : file_path_(file_path), icon_size_(size), callback_(callback) {} 32 : file_path_(file_path), icon_size_(size), callback_(callback) {}
33 33
34 IconLoader::~IconLoader() {} 34 IconLoader::~IconLoader() {}
35 35
36 void IconLoader::ReadGroup() { 36 void IconLoader::ReadGroup() {
37 group_ = GroupForFilepath(file_path_); 37 group_ = GroupForFilepath(file_path_);
38 } 38 }
39 39
40 void IconLoader::OnReadGroup() { 40 void IconLoader::OnReadGroup() {
41 BrowserThread::PostTask( 41 BrowserThread::PostTask(
42 ReadIconThreadID(), FROM_HERE, 42 ReadIconThreadID(), FROM_HERE,
43 base::Bind(&IconLoader::ReadIcon, base::Unretained(this))); 43 base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this)));
44 } 44 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/icon_loader_auralinux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698