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

Unified Diff: services/service_manager/runner/common/client_util.cc

Issue 2680973006: Mojo EDK: Add safe process connection API (Closed)
Patch Set: . Created 3 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: services/service_manager/runner/common/client_util.cc
diff --git a/services/service_manager/runner/common/client_util.cc b/services/service_manager/runner/common/client_util.cc
index 082d30696606b49d5cc21662419d11cc4204f040..efbfe42bf879b6f66aa7267f33dbaa7984192897 100644
--- a/services/service_manager/runner/common/client_util.cc
+++ b/services/service_manager/runner/common/client_util.cc
@@ -8,19 +8,18 @@
#include "base/command_line.h"
#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/pending_process_connection.h"
#include "services/service_manager/runner/common/switches.h"
namespace service_manager {
mojom::ServicePtr PassServiceRequestOnCommandLine(
- base::CommandLine* command_line, const std::string& child_token) {
- std::string token = mojo::edk::GenerateRandomToken();
- command_line->AppendSwitchASCII(switches::kPrimordialPipeToken, token);
-
+ mojo::edk::PendingProcessConnection* connection,
+ base::CommandLine* command_line) {
+ std::string token;
mojom::ServicePtr client;
- client.Bind(
- mojom::ServicePtrInfo(
- mojo::edk::CreateParentMessagePipe(token, child_token), 0));
+ client.Bind(mojom::ServicePtrInfo(connection->CreateMessagePipe(&token), 0));
+ command_line->AppendSwitchASCII(switches::kPrimordialPipeToken, token);
return client;
}
« no previous file with comments | « services/service_manager/runner/common/client_util.h ('k') | services/service_manager/runner/host/service_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698