Index: mojo/edk/system/core.cc |
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc |
index aad9541642fcad64ef94c40dc7cfd2ef8feeceae..99978af5fdd6b275260e84dcc643fd38fdeefc33 100644 |
--- a/mojo/edk/system/core.cc |
+++ b/mojo/edk/system/core.cc |
@@ -160,14 +160,16 @@ void Core::RequestShutdown(const base::Closure& callback) { |
GetNodeController()->RequestShutdown(on_shutdown); |
} |
-void Core::CreateMessagePipe( |
- ScopedPlatformHandle platform_handle, |
- const base::Callback<void(ScopedMessagePipeHandle)>& callback) { |
- ports::PortRef port; |
- GetNodeController()->node()->CreateUninitializedPort(&port); |
+ScopedMessagePipeHandle Core::CreateMessagePipe( |
+ ScopedPlatformHandle platform_handle) { |
+ ports::PortRef port0, port1; |
+ GetNodeController()->node()->CreatePortPair(&port0, &port1); |
+ MojoHandle handle = AddDispatcher( |
+ new MessagePipeDispatcher(GetNodeController(), port0, |
+ 0x7f7f7f7f7f7f7f7fUL, 0)); |
RemoteMessagePipeBootstrap::Create( |
- GetNodeController(), std::move(platform_handle), port, |
- base::Bind(&OnPortConnected, base::Unretained(this), 0, callback, port)); |
+ GetNodeController(), std::move(platform_handle), port1); |
+ return ScopedMessagePipeHandle(MessagePipeHandle(handle)); |
} |
void Core::CreateParentMessagePipe( |