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

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 2547173002: Use TaskScheduler instead of WorkerPool in debug_daemon_client.cc. (Closed)
Patch Set: may block Created 4 years 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/debug_daemon_client.cc
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index eda3a100ede97314e16a0d77c11ca75f9b47999b..868a60f290c134064a7dc099ffcb6913f6c50590 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -22,9 +22,8 @@
#include "base/message_loop/message_loop.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/string_util.h"
-#include "base/task_runner_util.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "base/threading/worker_pool.h"
#include "chromeos/dbus/pipe_reader.h"
#include "dbus/bus.h"
#include "dbus/message.h"
@@ -55,9 +54,9 @@ void EmptyStopAgentTracingCallbackBody(
class PipeReaderWrapper : public base::SupportsWeakPtr<PipeReaderWrapper> {
public:
explicit PipeReaderWrapper(const DebugDaemonClient::GetLogsCallback& callback)
- : task_runner_(
- base::WorkerPool::GetTaskRunner(true /** tasks_are_slow */)),
- pipe_reader_(task_runner_,
+ : pipe_reader_(base::CreateTaskRunnerWithTraits(
+ base::TaskTraits().MayBlock().WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)),
base::Bind(&PipeReaderWrapper::OnIOComplete, AsWeakPtr())),
callback_(callback) {}
@@ -93,7 +92,6 @@ class PipeReaderWrapper : public base::SupportsWeakPtr<PipeReaderWrapper> {
void TerminateStream() { pipe_reader_.OnDataReady(-1); }
private:
- scoped_refptr<base::TaskRunner> task_runner_;
PipeReaderForString pipe_reader_;
DebugDaemonClient::GetLogsCallback callback_;
« 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