| Index: base/threading/sequenced_worker_pool.cc
|
| diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
|
| index 532f26ebe5c784eba7613045ef99f5c40b012714..9503f994fb319696a4fb6959b830768f2b5fcceb 100644
|
| --- a/base/threading/sequenced_worker_pool.cc
|
| +++ b/base/threading/sequenced_worker_pool.cc
|
| @@ -23,6 +23,7 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "base/synchronization/condition_variable.h"
|
| #include "base/synchronization/lock.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "base/threading/platform_thread.h"
|
| #include "base/threading/simple_thread.h"
|
| #include "base/threading/thread_local.h"
|
| @@ -1141,29 +1142,27 @@ SequencedWorkerPool::GetSequenceTokenForCurrentThread() {
|
| return *token;
|
| }
|
|
|
| -SequencedWorkerPool::SequencedWorkerPool(
|
| - size_t max_threads,
|
| - const std::string& thread_name_prefix)
|
| - : constructor_message_loop_(MessageLoopProxy::current()),
|
| +SequencedWorkerPool::SequencedWorkerPool(size_t max_threads,
|
| + const std::string& thread_name_prefix)
|
| + : constructor_task_runner_(ThreadTaskRunnerHandle::Get()),
|
| inner_(new Inner(this, max_threads, thread_name_prefix, NULL)) {
|
| }
|
|
|
| -SequencedWorkerPool::SequencedWorkerPool(
|
| - size_t max_threads,
|
| - const std::string& thread_name_prefix,
|
| - TestingObserver* observer)
|
| - : constructor_message_loop_(MessageLoopProxy::current()),
|
| +SequencedWorkerPool::SequencedWorkerPool(size_t max_threads,
|
| + const std::string& thread_name_prefix,
|
| + TestingObserver* observer)
|
| + : constructor_task_runner_(ThreadTaskRunnerHandle::Get()),
|
| inner_(new Inner(this, max_threads, thread_name_prefix, observer)) {
|
| }
|
|
|
| SequencedWorkerPool::~SequencedWorkerPool() {}
|
|
|
| void SequencedWorkerPool::OnDestruct() const {
|
| - DCHECK(constructor_message_loop_.get());
|
| + DCHECK(constructor_task_runner_.get());
|
| // Avoid deleting ourselves on a worker thread (which would
|
| // deadlock).
|
| if (RunsTasksOnCurrentThread()) {
|
| - constructor_message_loop_->DeleteSoon(FROM_HERE, this);
|
| + constructor_task_runner_->DeleteSoon(FROM_HERE, this);
|
| } else {
|
| delete this;
|
| }
|
| @@ -1283,7 +1282,7 @@ void SequencedWorkerPool::SignalHasWorkForTesting() {
|
| }
|
|
|
| void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
|
| - DCHECK(constructor_message_loop_->BelongsToCurrentThread());
|
| + DCHECK(constructor_task_runner_->RunsTasksOnCurrentThread());
|
| inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
|
| }
|
|
|
|
|