Index: mojo/common/channel_init.cc |
diff --git a/mojo/common/mojo_channel_init.cc b/mojo/common/channel_init.cc |
similarity index 77% |
rename from mojo/common/mojo_channel_init.cc |
rename to mojo/common/channel_init.cc |
index 96190f9d5d051fd33ad2152f3af075fe3be0ae76..7eef2aec705d47c8b6f07e79b521fbb43c359b2b 100644 |
--- a/mojo/common/mojo_channel_init.cc |
+++ b/mojo/common/channel_init.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "mojo/common/mojo_channel_init.h" |
+#include "mojo/common/channel_init.h" |
#include "base/bind.h" |
#include "base/message_loop/message_loop.h" |
@@ -11,13 +11,12 @@ |
namespace mojo { |
namespace common { |
-MojoChannelInit::MojoChannelInit() |
+ChannelInit::ChannelInit() |
: channel_info_(NULL), |
weak_factory_(this) { |
} |
-MojoChannelInit::~MojoChannelInit() { |
- bootstrap_message_pipe_.reset(); |
+ChannelInit::~ChannelInit() { |
if (channel_info_) { |
io_thread_task_runner_->PostTask( |
FROM_HERE, |
@@ -25,23 +24,24 @@ MojoChannelInit::~MojoChannelInit() { |
} |
} |
-void MojoChannelInit::Init( |
+mojo::ScopedMessagePipeHandle ChannelInit::Init( |
base::PlatformFile file, |
scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
DCHECK(!io_thread_task_runner_.get()); // Should only init once. |
io_thread_task_runner_ = io_thread_task_runner; |
- bootstrap_message_pipe_ = mojo::embedder::CreateChannel( |
+ mojo::ScopedMessagePipeHandle message_pipe = mojo::embedder::CreateChannel( |
mojo::embedder::ScopedPlatformHandle( |
mojo::embedder::PlatformHandle(file)), |
io_thread_task_runner, |
- base::Bind(&MojoChannelInit::OnCreatedChannel, weak_factory_.GetWeakPtr(), |
+ base::Bind(&ChannelInit::OnCreatedChannel, weak_factory_.GetWeakPtr(), |
io_thread_task_runner), |
base::MessageLoop::current()->message_loop_proxy()).Pass(); |
+ return message_pipe.Pass(); |
} |
// static |
-void MojoChannelInit::OnCreatedChannel( |
- base::WeakPtr<MojoChannelInit> host, |
+void ChannelInit::OnCreatedChannel( |
+ base::WeakPtr<ChannelInit> host, |
scoped_refptr<base::TaskRunner> io_thread, |
embedder::ChannelInfo* channel) { |
// By the time we get here |host| may have been destroyed. If so, shutdown the |