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

Unified Diff: chrome/browser/printing/print_job.cc

Issue 2855543003: Use TaskScheduler instead of WorkerPool in print_job.cc. (Closed)
Patch Set: self-review 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/printing/print_job.cc
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 7fde330b43a56f29fb3bca1008dca516b80fcc32..8aa70abb276cb035097be63877aa588f011bedf5 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -14,10 +14,10 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "base/threading/worker_pool.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/printing/print_job_worker.h"
@@ -444,13 +444,20 @@ void PrintJob::ControlledWorkerShutdown() {
}
#endif
-
// Now make sure the thread object is cleaned up. Do this on a worker
// thread because it may block.
- base::WorkerPool::PostTaskAndReply(
+ // TODO(fdoray): Remove MayBlock() once base::Thread::Stop() passes
+ // base::ThreadRestrictions::AssertWaitAllowed().
+ base::PostTaskWithTraitsAndReply(
FROM_HERE,
+ base::TaskTraits()
+ .MayBlock()
+ .WithBaseSyncPrimitives()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
base::BindOnce(&PrintJobWorker::Stop, base::Unretained(worker_.get())),
- base::BindOnce(&PrintJob::HoldUntilStopIsCalled, this), false);
+ base::BindOnce(&PrintJob::HoldUntilStopIsCalled, this));
is_job_pending_ = false;
registrar_.RemoveAll();
« 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