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

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

Issue 2227553002: Support mojo connections between unrelated peer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index 4bb07eaf3886bb113df9dbbd3bbb4c0c681751b5..d2a421ebeeee474cde11153c9f339cc1f8bac05d 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -187,6 +187,17 @@ void Core::ChildLaunchFailed(const std::string& child_token) {
GetNodeController()->CloseChildPorts(child_token);
}
+ScopedMessagePipeHandle Core::ConnectToPeerProcess(
+ ScopedPlatformHandle pipe_handle) {
+ RequestContext request_context;
+ ports::PortRef port0, port1;
+ GetNodeController()->node()->CreatePortPair(&port0, &port1);
+ MojoHandle handle = AddDispatcher(new MessagePipeDispatcher(
+ GetNodeController(), port0, kUnknownPipeIdForDebug, 0));
+ GetNodeController()->ConnectToPeer(std::move(pipe_handle), port1);
+ return ScopedMessagePipeHandle(MessagePipeHandle(handle));
+}
+
void Core::InitChild(ScopedPlatformHandle platform_handle) {
GetNodeController()->ConnectToParent(std::move(platform_handle));
}
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698