Commit ccee5da9 authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of blocking pool in supervised_user_site_list.cc.

The blocking pool is being deprecated in favor of TaskScheduler.

BUG=667892
R=bauerb@chromium.org

Review-Url: https://codereview.chromium.org/2841643003
Cr-Commit-Position: refs/heads/master@{#467643}
parent b7503b4c
...@@ -11,10 +11,8 @@ ...@@ -11,10 +11,8 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/task_runner_util.h" #include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/values.h" #include "base/values.h"
#include "content/public/browser/browser_thread.h"
#include "url/gurl.h" #include "url/gurl.h"
const int kLegacyWhitelistFormatVersion = 2; const int kLegacyWhitelistFormatVersion = 2;
...@@ -91,14 +89,16 @@ void SupervisedUserSiteList::Load(const std::string& id, ...@@ -91,14 +89,16 @@ void SupervisedUserSiteList::Load(const std::string& id,
const base::FilePath& large_icon_path, const base::FilePath& large_icon_path,
const base::FilePath& path, const base::FilePath& path,
const LoadedCallback& callback) { const LoadedCallback& callback) {
base::PostTaskAndReplyWithResult( base::PostTaskWithTraitsAndReplyWithResult(
content::BrowserThread::GetBlockingPool() FROM_HERE,
->GetTaskRunnerWithShutdownBehavior( base::TaskTraits()
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN) .MayBlock()
.get(), .WithPriority(base::TaskPriority::BACKGROUND)
FROM_HERE, base::Bind(&ReadFileOnBlockingThread, path), .WithShutdownBehavior(
base::Bind(&SupervisedUserSiteList::OnJsonLoaded, id, title, base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
large_icon_path, path, base::TimeTicks::Now(), callback)); base::BindOnce(&ReadFileOnBlockingThread, path),
base::BindOnce(&SupervisedUserSiteList::OnJsonLoaded, id, title,
large_icon_path, path, base::TimeTicks::Now(), callback));
} }
SupervisedUserSiteList::SupervisedUserSiteList( SupervisedUserSiteList::SupervisedUserSiteList(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment