Chromium Code Reviews| Index: mojo/system/channel.cc |
| diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc |
| index d7a720eb9b56c1ec69b3db159dbfb428510b1336..14923e2bd8fce1a236de97387ddf0e56d18cf86e 100644 |
| --- a/mojo/system/channel.cc |
| +++ b/mojo/system/channel.cc |
| @@ -8,7 +8,6 @@ |
| #include "base/bind.h" |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| -#include "base/message_loop/message_loop.h" |
| #include "base/strings/stringprintf.h" |
| #include "mojo/system/message_pipe_endpoint.h" |
| @@ -38,18 +37,16 @@ Channel::Channel() |
| : next_local_id_(kBootstrapEndpointId) { |
| } |
| -bool Channel::Init(embedder::ScopedPlatformHandle handle) { |
| +bool Channel:: Init(scoped_ptr<RawChannel> raw_channel) { |
|
sky
2014/04/03 22:34:29
nit: spurious space.
|
| DCHECK(creation_thread_checker_.CalledOnValidThread()); |
| + DCHECK(raw_channel); |
| // No need to take |lock_|, since this must be called before this object |
| // becomes thread-safe. |
| - DCHECK(!raw_channel_.get()); |
| + DCHECK(!raw_channel_); |
| + raw_channel_ = raw_channel.Pass(); |
| - CHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_IO); |
| - raw_channel_.reset(RawChannel::Create(handle.Pass(), this, |
| - static_cast<base::MessageLoopForIO*>( |
| - base::MessageLoop::current()))); |
| - if (!raw_channel_->Init()) { |
| + if (!raw_channel_->Init(this)) { |
| raw_channel_.reset(); |
| return false; |
| } |