| Index: components/nacl/loader/nacl_listener.cc
|
| diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
|
| index 146b855f2e10ab64adb441de7b9c30779308a84c..66f967178fe7f22a84aba89258dcc6f483a11955 100644
|
| --- a/components/nacl/loader/nacl_listener.cc
|
| +++ b/components/nacl/loader/nacl_listener.cc
|
| @@ -19,7 +19,9 @@
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "base/rand_util.h"
|
| +#include "base/run_loop.h"
|
| #include "base/single_thread_task_runner.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
| #include "build/build_config.h"
|
| #include "components/nacl/common/nacl_messages.h"
|
| #include "components/nacl/common/nacl_renderer_messages.h"
|
| @@ -165,7 +167,6 @@ NaClListener::NaClListener()
|
| #if defined(OS_POSIX)
|
| number_of_cores_(-1), // unknown/error
|
| #endif
|
| - main_loop_(NULL),
|
| is_started_(false) {
|
| IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
|
| io_thread_.StartWithOptions(
|
| @@ -181,8 +182,8 @@ NaClListener::~NaClListener() {
|
| }
|
|
|
| bool NaClListener::Send(IPC::Message* msg) {
|
| - DCHECK(main_loop_ != NULL);
|
| - if (base::MessageLoop::current() == main_loop_) {
|
| + DCHECK(!!main_task_runner_);
|
| + if (main_task_runner_->BelongsToCurrentThread()) {
|
| // This thread owns the channel.
|
| return channel_->Send(msg);
|
| } else {
|
| @@ -231,7 +232,7 @@ void NaClListener::Listen() {
|
| if (global && !global->IsPrivilegedBroker())
|
| global->RegisterBrokerCommunicationChannel(channel_.get());
|
| channel_->Init(channel_name, IPC::Channel::MODE_CLIENT, true);
|
| - main_loop_ = base::MessageLoop::current();
|
| + main_task_runner_ = base::ThreadTaskRunnerHandle::Get();
|
| base::RunLoop().Run();
|
| }
|
|
|
|
|