| Index: base/threading/sequenced_worker_pool.cc
|
| diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
|
| index 459c31bc4144f07ee270bfd0038ad1759f5943e5..6f4a248aaf6cd2a0492f45c3647258f05c20fc31 100644
|
| --- a/base/threading/sequenced_worker_pool.cc
|
| +++ b/base/threading/sequenced_worker_pool.cc
|
| @@ -17,11 +17,11 @@
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/memory/linked_ptr.h"
|
| +#include "base/message_loop/message_loop_proxy.h"
|
| #include "base/stl_util.h"
|
| #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"
|
| @@ -1158,27 +1158,29 @@
|
| return *token;
|
| }
|
|
|
| -SequencedWorkerPool::SequencedWorkerPool(size_t max_threads,
|
| - const std::string& thread_name_prefix)
|
| - : constructor_task_runner_(ThreadTaskRunnerHandle::Get()),
|
| +SequencedWorkerPool::SequencedWorkerPool(
|
| + size_t max_threads,
|
| + const std::string& thread_name_prefix)
|
| + : constructor_message_loop_(MessageLoopProxy::current()),
|
| 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_task_runner_(ThreadTaskRunnerHandle::Get()),
|
| +SequencedWorkerPool::SequencedWorkerPool(
|
| + size_t max_threads,
|
| + const std::string& thread_name_prefix,
|
| + TestingObserver* observer)
|
| + : constructor_message_loop_(MessageLoopProxy::current()),
|
| inner_(new Inner(this, max_threads, thread_name_prefix, observer)) {
|
| }
|
|
|
| SequencedWorkerPool::~SequencedWorkerPool() {}
|
|
|
| void SequencedWorkerPool::OnDestruct() const {
|
| - DCHECK(constructor_task_runner_);
|
| + DCHECK(constructor_message_loop_.get());
|
| // Avoid deleting ourselves on a worker thread (which would
|
| // deadlock).
|
| if (RunsTasksOnCurrentThread()) {
|
| - constructor_task_runner_->DeleteSoon(FROM_HERE, this);
|
| + constructor_message_loop_->DeleteSoon(FROM_HERE, this);
|
| } else {
|
| delete this;
|
| }
|
| @@ -1298,7 +1300,7 @@
|
| }
|
|
|
| void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
|
| - DCHECK(constructor_task_runner_->BelongsToCurrentThread());
|
| + DCHECK(constructor_message_loop_->BelongsToCurrentThread());
|
| inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
|
| }
|
|
|
|
|