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

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

Issue 2843583002: Use TaskScheduler instead of blocking pool in supervised_user_service.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_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index 2acd84abd580ed53bb470fb493aca712889a6de4..0010c22c72bb65735b84c8bd39c78255cc74445b 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -17,7 +17,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_runner_util.h"
-#include "base/threading/sequenced_worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "base/version.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -755,10 +755,14 @@ void SupervisedUserService::LoadBlacklist(const base::FilePath& path,
DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED);
blacklist_state_ = BlacklistLoadState::LOAD_STARTED;
base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN).get(),
- FROM_HERE,
- base::Bind(&base::PathExists, path),
+ base::CreateTaskRunnerWithTraits(
Bernhard Bauer 2017/04/25 14:18:23 Can you use PostTaskWithTraitsAndReplyWithResult()
fdoray 2017/04/27 13:03:17 Done.
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN))
+ .get(),
+ FROM_HERE, base::Bind(&base::PathExists, path),
base::Bind(&SupervisedUserService::OnBlacklistFileChecked,
weak_ptr_factory_.GetWeakPtr(), path, url));
}
« 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