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

Unified Diff: chrome/browser/icon_loader.cc

Issue 2953633002: Move the IconLoader to use the task scheduler. (Closed)
Patch Set: rev Created 3 years, 6 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_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 d679bd3598331ad1bda2c5228218a4bef291b110..aecc25d7ed64ffbd46f03cd8f935a1df3e1dc098 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,8 +24,8 @@ IconLoader* IconLoader::Create(const base::FilePath& file_path,
void IconLoader::Start() {
target_task_runner_ = base::ThreadTaskRunnerHandle::Get();
- BrowserThread::PostTaskAndReply(
- BrowserThread::FILE, FROM_HERE,
+ base::PostTaskWithTraitsAndReply(
gab 2017/06/22 19:49:41 This is fine so long as IconLoader::Start() is onl
Avi (use Gerrit) 2017/06/22 20:31:45 Acknowledged.
+ FROM_HERE, traits(),
base::BindOnce(&IconLoader::ReadGroup, base::Unretained(this)),
base::BindOnce(&IconLoader::OnReadGroup, base::Unretained(this)));
}
@@ -38,7 +42,6 @@ void IconLoader::ReadGroup() {
}
void IconLoader::OnReadGroup() {
- BrowserThread::PostTask(
- ReadIconThreadID(), FROM_HERE,
- base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this)));
+ ReadIconTaskRunner()->PostTask(
gab 2017/06/22 19:49:41 This is also fine because the execution model seem
Avi (use Gerrit) 2017/06/22 20:31:45 On the Linux platforms, the group determination ne
+ FROM_HERE, base::BindOnce(&IconLoader::ReadIcon, base::Unretained(this)));
}
« 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