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

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: fix-build-error 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..e2f6e6c841a0b8236e5ca5261db692637e67058b 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -16,8 +16,7 @@
#include "base/path_service.h"
#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"
@@ -754,13 +753,16 @@ void SupervisedUserService::LoadBlacklist(const base::FilePath& path,
const GURL& url) {
DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED);
blacklist_state_ = BlacklistLoadState::LOAD_STARTED;
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN).get(),
+ base::PostTaskWithTraitsAndReplyWithResult(
FROM_HERE,
- base::Bind(&base::PathExists, path),
- base::Bind(&SupervisedUserService::OnBlacklistFileChecked,
- weak_ptr_factory_.GetWeakPtr(), path, url));
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ base::BindOnce(&base::PathExists, path),
+ base::BindOnce(&SupervisedUserService::OnBlacklistFileChecked,
+ weak_ptr_factory_.GetWeakPtr(), path, url));
}
void SupervisedUserService::OnBlacklistFileChecked(const base::FilePath& path,
« 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