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

Unified Diff: content/common/child_process_host_impl.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
« no previous file with comments | « content/common/child_process_host_impl.h ('k') | content/common/service_manager/child_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_process_host_impl.cc
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
index c64d2b71c3ffe8a5759cec1c98dbef314d6bc73b..082906f5b6f48f77e40e524c4236c98af6cc10e8 100644
--- a/content/common/child_process_host_impl.cc
+++ b/content/common/child_process_host_impl.cc
@@ -121,16 +121,13 @@ void ChildProcessHostImpl::ForceShutdown() {
}
std::string ChildProcessHostImpl::CreateChannelMojo(
- const std::string& child_token) {
+ mojo::edk::PendingProcessConnection* connection) {
DCHECK(channel_id_.empty());
- channel_id_ = mojo::edk::GenerateRandomToken();
- mojo::ScopedMessagePipeHandle host_handle =
- mojo::edk::CreateParentMessagePipe(channel_id_, child_token);
- channel_ = IPC::ChannelMojo::Create(std::move(host_handle),
- IPC::Channel::MODE_SERVER, this);
+ channel_ =
+ IPC::ChannelMojo::Create(connection->CreateMessagePipe(&channel_id_),
+ IPC::Channel::MODE_SERVER, this);
if (!channel_ || !InitChannel())
return std::string();
-
return channel_id_;
}
« no previous file with comments | « content/common/child_process_host_impl.h ('k') | content/common/service_manager/child_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698