Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Unified Diff: content/common/mojo/mojo_channel_init.cc

Issue 236813002: Move Mojo channel initialization closer to IPC::Channel setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/mojo/mojo_channel_init.cc
diff --git a/content/common/mojo/mojo_channel_init.cc b/content/common/mojo/mojo_channel_init.cc
index 16661ab1121f874d2d3d2d36ee66c2aa3cbfe6cc..59137243a72a199dc40f8faf5350463904149e62 100644
--- a/content/common/mojo/mojo_channel_init.cc
+++ b/content/common/mojo/mojo_channel_init.cc
@@ -16,7 +16,6 @@ MojoChannelInit::MojoChannelInit()
}
MojoChannelInit::~MojoChannelInit() {
- bootstrap_message_pipe_.reset();
if (channel_info_) {
io_thread_task_runner_->PostTask(
FROM_HERE,
@@ -24,18 +23,19 @@ MojoChannelInit::~MojoChannelInit() {
}
}
-void MojoChannelInit::Init(
+mojo::ScopedMessagePipeHandle MojoChannelInit::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(),
io_thread_task_runner),
base::MessageLoop::current()->message_loop_proxy()).Pass();
+ return message_pipe.Pass();
}
// static

Powered by Google App Engine
This is Rietveld 408576698