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

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: 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..8672659787954b24802450aa6407c9eb16c6b05c 100644
--- a/chrome/browser/supervised_user/supervised_user_site_list.cc
+++ b/chrome/browser/supervised_user/supervised_user_site_list.cc
@@ -12,9 +12,8 @@
#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;
@@ -92,9 +91,12 @@ void SupervisedUserSiteList::Load(const std::string& id,
const base::FilePath& path,
const LoadedCallback& callback) {
base::PostTaskAndReplyWithResult(
- content::BrowserThread::GetBlockingPool()
- ->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)
+ base::CreateTaskRunnerWithTraits(
Bernhard Bauer 2017/04/25 14:20:21 Can you use PostTaskWithTraitsAndReplyWithResult()
fdoray 2017/04/26 19:33:50 Done.
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN))
.get(),
FROM_HERE, base::Bind(&ReadFileOnBlockingThread, path),
base::Bind(&SupervisedUserSiteList::OnJsonLoaded, id, title,
« 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