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

Unified Diff: chromeos/dbus/fake_auth_policy_client.cc

Issue 2607273002: Use TaskScheduler instead of WorkerPool in fake_auth_policy_client.cc. (Closed)
Patch Set: fix build error Created 3 years, 12 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: chromeos/dbus/fake_auth_policy_client.cc
diff --git a/chromeos/dbus/fake_auth_policy_client.cc b/chromeos/dbus/fake_auth_policy_client.cc
index b822db46ca82095d79745fe7ed6a4cec67a50c8c..f37f1ea53bc88d6aa576485db9d67fb310e6978b 100644
--- a/chromeos/dbus/fake_auth_policy_client.cc
+++ b/chromeos/dbus/fake_auth_policy_client.cc
@@ -10,8 +10,7 @@
#include "base/location.h"
#include "base/md5.h"
#include "base/path_service.h"
-#include "base/task_runner_util.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/cryptohome/cryptohome_parameters.h"
@@ -90,13 +89,14 @@ void FakeAuthPolicyClient::RefreshDevicePolicy(
CHECK(policy.SerializeToString(&payload));
// Drop file for SessionManagerClientStubImpl to read.
- if (!base::PostTaskAndReplyWithResult(
- base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(),
- FROM_HERE, base::Bind(&WritePolicyFile, policy_path, payload,
- "google/chromeos/device"),
- callback)) {
- callback.Run(false);
- }
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .MayBlock(),
+ Bind(&WritePolicyFile, policy_path, payload, "google/chromeos/device"),
+ callback);
}
void FakeAuthPolicyClient::RefreshUserPolicy(
@@ -119,13 +119,15 @@ void FakeAuthPolicyClient::RefreshUserPolicy(
CHECK(policy.SerializeToString(&payload));
// Drop file for SessionManagerClientStubImpl to read.
- if (!base::PostTaskAndReplyWithResult(
- base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(),
- FROM_HERE, base::Bind(&WritePolicyFile, policy_path, payload,
- "google/chromeos/user"),
- callback)) {
- callback.Run(false);
- }
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .MayBlock(),
+ base::Bind(&WritePolicyFile, policy_path, payload,
+ "google/chromeos/user"),
+ callback);
}
} // namespace chromeos
« 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