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

Unified Diff: mojo/edk/system/core.cc

Issue 1675603002: [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: 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(

Powered by Google App Engine
This is Rietveld 408576698