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

Unified Diff: chrome/browser/supervised_user/supervised_user_site_list.cc

Issue 2841643003: Use TaskScheduler instead of blocking pool in supervised_user_site_list.cc. (Closed)
Patch Set: self-review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_site_list.cc
diff --git a/chrome/browser/supervised_user/supervised_user_site_list.cc b/chrome/browser/supervised_user/supervised_user_site_list.cc
index 8b9253b26ec009f5991b94c4d2a557e31c4b5b6e..9a7c71623e5da67fbbccb1e0cb006e410ca2234e 100644
--- a/chrome/browser/supervised_user/supervised_user_site_list.cc
+++ b/chrome/browser/supervised_user/supervised_user_site_list.cc
@@ -11,10 +11,8 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
-#include "base/task_runner_util.h"
-#include "base/threading/sequenced_worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "base/values.h"
-#include "content/public/browser/browser_thread.h"
#include "url/gurl.h"
const int kLegacyWhitelistFormatVersion = 2;
@@ -91,14 +89,16 @@ void SupervisedUserSiteList::Load(const std::string& id,
const base::FilePath& large_icon_path,
const base::FilePath& path,
const LoadedCallback& callback) {
- base::PostTaskAndReplyWithResult(
- content::BrowserThread::GetBlockingPool()
- ->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)
- .get(),
- FROM_HERE, base::Bind(&ReadFileOnBlockingThread, path),
- base::Bind(&SupervisedUserSiteList::OnJsonLoaded, id, title,
- large_icon_path, path, base::TimeTicks::Now(), callback));
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE,
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ base::BindOnce(&ReadFileOnBlockingThread, path),
+ base::BindOnce(&SupervisedUserSiteList::OnJsonLoaded, id, title,
+ large_icon_path, path, base::TimeTicks::Now(), callback));
}
SupervisedUserSiteList::SupervisedUserSiteList(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698