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

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

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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/node_controller.h » ('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 355c65f667a094dcc200a10f4201f47da14ea06c..acc67fc2b6e127f6f8556f35a59bc1cd4f6d2c51 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -169,9 +169,16 @@ scoped_refptr<Dispatcher> Core::GetDispatcher(MojoHandle handle) {
}
void Core::AddChild(base::ProcessHandle process_handle,
- ScopedPlatformHandle platform_handle) {
+ ScopedPlatformHandle platform_handle,
+ const std::string& child_token) {
GetNodeController()->ConnectToChild(process_handle,
- std::move(platform_handle));
+ std::move(platform_handle),
+ child_token);
+}
+
+void Core::ChildLaunchFailed(const std::string& child_token) {
+ RequestContext request_context;
+ GetNodeController()->CloseChildPorts(child_token);
}
void Core::InitChild(ScopedPlatformHandle platform_handle) {
@@ -327,14 +334,14 @@ ScopedMessagePipeHandle Core::CreateMessagePipe(
}
ScopedMessagePipeHandle Core::CreateParentMessagePipe(
- const std::string& token) {
+ const std::string& token, const std::string& child_token) {
RequestContext request_context;
ports::PortRef port0, port1;
GetNodeController()->node()->CreatePortPair(&port0, &port1);
MojoHandle handle = AddDispatcher(
new MessagePipeDispatcher(GetNodeController(), port0,
kUnknownPipeIdForDebug, 0));
- GetNodeController()->ReservePort(token, port1);
+ GetNodeController()->ReservePort(token, port1, child_token);
return ScopedMessagePipeHandle(MessagePipeHandle(handle));
}
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/node_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698