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

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
« no previous file with comments | « content/browser/browser_child_process_host_impl.h ('k') | content/browser/child_process_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8e51064b49176781fd04f5f2f1d3936d8507e24a 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),
@@ -179,10 +179,11 @@ 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_,
- ServiceManagerContext::GetConnectorForIOThread(),
- base::ThreadTaskRunnerHandle::Get()));
+ child_connection_.reset(
+ new ChildConnection(service_name, base::StringPrintf("%d", data_.id),
+ pending_connection_.get(),
+ ServiceManagerContext::GetConnectorForIOThread(),
+ base::ThreadTaskRunnerHandle::Get()));
}
// May be null during test execution.
@@ -256,7 +257,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()),
« no previous file with comments | « content/browser/browser_child_process_host_impl.h ('k') | content/browser/child_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698