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

Unified Diff: content/browser/browser_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
Index: content/browser/browser_child_process_host_impl.cc
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 6da88a2fca090aacc6a915a972106859da5a7d05..79ec921b10ec75ee224b81e90c9bd88865ad12a6 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -161,7 +161,7 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
const std::string& service_name)
: data_(process_type),
delegate_(delegate),
- child_token_(mojo::edk::GenerateRandomToken()),
+ pending_connection_(new mojo::edk::PendingProcessConnection),
channel_(nullptr),
is_channel_connected_(false),
notify_child_disconnected_(false),
@@ -180,7 +180,7 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
if (!service_name.empty()) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
child_connection_.reset(new ChildConnection(
- service_name, base::StringPrintf("%d", data_.id), child_token_,
+ service_name, base::StringPrintf("%d", data_.id), *pending_connection_,
ServiceManagerContext::GetConnectorForIOThread(),
base::ThreadTaskRunnerHandle::Get()));
}
@@ -256,7 +256,8 @@ void BrowserChildProcessHostImpl::Launch(
notify_child_disconnected_ = true;
child_process_.reset(new ChildProcessLauncher(
- std::move(delegate), std::move(cmd_line), data_.id, this, child_token_,
+ std::move(delegate), std::move(cmd_line), data_.id, this,
+ std::move(pending_connection_),
base::Bind(&BrowserChildProcessHostImpl::OnMojoError,
weak_factory_.GetWeakPtr(),
base::ThreadTaskRunnerHandle::Get()),

Powered by Google App Engine
This is Rietveld 408576698