Index: chrome/browser/icon_loader.cc |
diff --git a/chrome/browser/icon_loader.cc b/chrome/browser/icon_loader.cc |
index d679bd3598331ad1bda2c5228218a4bef291b110..a4934f00ca3df3945f0716db33d63161215e256a 100644 |
--- a/chrome/browser/icon_loader.cc |
+++ b/chrome/browser/icon_loader.cc |
@@ -4,7 +4,11 @@ |
#include "chrome/browser/icon_loader.h" |
+#include <utility> |
+ |
#include "base/bind.h" |
+#include "base/task_scheduler/post_task.h" |
+#include "base/task_scheduler/task_traits.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "content/public/browser/browser_thread.h" |
@@ -20,10 +24,9 @@ IconLoader* IconLoader::Create(const base::FilePath& file_path, |
void IconLoader::Start() { |
target_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
- BrowserThread::PostTaskAndReply( |
- BrowserThread::FILE, FROM_HERE, |
- base::BindOnce(&IconLoader::ReadGroup, base::Unretained(this)), |
- base::BindOnce(&IconLoader::OnReadGroup, base::Unretained(this))); |
+ base::PostTaskWithTraits( |
+ FROM_HERE, traits(), |
+ base::BindOnce(&IconLoader::ReadGroup, base::Unretained(this))); |
} |
IconLoader::IconLoader(const base::FilePath& file_path, |
@@ -35,10 +38,7 @@ IconLoader::~IconLoader() {} |
void IconLoader::ReadGroup() { |
group_ = GroupForFilepath(file_path_); |
-} |
-void IconLoader::OnReadGroup() { |
- BrowserThread::PostTask( |
- ReadIconThreadID(), FROM_HERE, |
- base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this))); |
+ GetReadIconTaskRunner()->PostTask( |
+ FROM_HERE, base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this))); |
} |